[INTERPRETER]
* BUG: Do not close standard file descriptor during exit. git-svn-id: svn://localhost/gambas/trunk@1846 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
4d91620b03
commit
7b8d19516e
2 changed files with 7 additions and 3 deletions
|
@ -57,7 +57,7 @@ DECLARE_EVENT(EVENT_Write);
|
|||
static GB_FUNCTION read_func;
|
||||
|
||||
static char _buffer[16];
|
||||
|
||||
static bool _do_not_close = FALSE;
|
||||
|
||||
static void callback_read(int fd, int type, CFILE *file)
|
||||
{
|
||||
|
@ -127,9 +127,11 @@ void CFILE_init(void)
|
|||
|
||||
void CFILE_exit(void)
|
||||
{
|
||||
_do_not_close = TRUE;
|
||||
GB_Unref(POINTER(&CFILE_in));
|
||||
GB_Unref(POINTER(&CFILE_out));
|
||||
GB_Unref(POINTER(&CFILE_err));
|
||||
_do_not_close = FALSE;
|
||||
}
|
||||
|
||||
void CFILE_init_watch(void)
|
||||
|
@ -146,7 +148,9 @@ void CFILE_init_watch(void)
|
|||
|
||||
BEGIN_METHOD_VOID(CFILE_free)
|
||||
|
||||
STREAM_close(&THIS->ob.stream);
|
||||
if (!_do_not_close)
|
||||
STREAM_close(&THIS->ob.stream);
|
||||
|
||||
if (THIS->watch_fd >= 0)
|
||||
GB_Watch(THIS->watch_fd, GB_WATCH_NONE, NULL, 0);
|
||||
|
||||
|
|
|
@ -392,7 +392,7 @@ CLASS *CLASS_find(const char *name)
|
|||
#endif
|
||||
}
|
||||
|
||||
ALLOC_ZERO(&class, Max(128, sizeof(CLASS)), "CLASS_find");
|
||||
ALLOC_ZERO(&class, sizeof(CLASS), "CLASS_find");
|
||||
csym->class = class;
|
||||
/*csym->class->id = index;*/
|
||||
class->state = CS_NULL;
|
||||
|
|
Loading…
Reference in a new issue