mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Make closeDocument() re-entrant.
This commit is contained in:
committed by
Qingping Hou
parent
7609fc2dd0
commit
ee59fac328
5
pic.c
5
pic.c
@@ -178,10 +178,13 @@ static int getOriginalPageSize(lua_State *L) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* re-entrant */
|
||||
static int closeDocument(lua_State *L) {
|
||||
PicDocument *doc = (PicDocument*) luaL_checkudata(L, 1, "picdocument");
|
||||
if (doc->image != NULL)
|
||||
if (doc->image != NULL) {
|
||||
free(doc->image);
|
||||
doc->image = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user