Original Post
Hello, I am having issues with an error when I close my program in debug mode.
I do not have any problems whilst the program is running, but when I close it the debugger takes to to a function _lock_file() in _file.c which I presume is the compiler's code because I have never seen it before.
The error it gives me is:
and it brings me to this function:
Now this error only occurs when I try to close the program via the window. If I close it by pressing the X on the console, I don't get this error?
I do not have any problems whilst the program is running, but when I close it the debugger takes to to a function _lock_file() in _file.c which I presume is the compiler's code because I have never seen it before.
The error it gives me is:
Unhandled exception at 0x77838db9 in Engine.exe: 0xC0000005: Access violation writing location 0x00000014.and it brings me to this function:
void __cdecl _lock_file (
FILE *pf
)
{
/*
* The way the FILE (pointed to by pf) is locked depends on whether
* it is part of _iob[] or not
*/
if ( (pf >= _iob) && (pf <= (&_iob[_IOB_ENTRIES-1])) )
{
/*
* FILE lies in _iob[] so the lock lies in _locktable[].
*/
_lock( _STREAM_LOCKS + (int)(pf - _iob) );
/* We set _IOLOCKED to indicate we locked the stream */
pf->_flag |= _IOLOCKED;
}
else
/*
* Not part of _iob[]. Therefore, *pf is a _FILEX and the
* lock field of the struct is an initialized critical
* section.
*/
EnterCriticalSection( &(((_FILEX *)pf)->lock) );
}Now this error only occurs when I try to close the program via the window. If I close it by pressing the X on the console, I don't get this error?