The handle gets nulled out if the user has closed the file; don't pass that
null to fclose() in a garbage collection destructor too...
This commit is contained in:
parent
7d631e4959
commit
33e01e431d
@ -79,7 +79,8 @@ static void ghostDestroy(void* g)
|
|||||||
|
|
||||||
static void ioclose(naContext c, void* f)
|
static void ioclose(naContext c, void* f)
|
||||||
{
|
{
|
||||||
if(fclose(f) != 0 && c) naRuntimeError(c, strerror(errno));
|
if(f)
|
||||||
|
if(fclose(f) != 0 && c) naRuntimeError(c, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ioread(naContext c, void* f, char* buf, unsigned int len)
|
static int ioread(naContext c, void* f, char* buf, unsigned int len)
|
||||||
|
Loading…
Reference in New Issue
Block a user