diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 2470fc0b3..a4f4418e5 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -23845,7 +23845,7 @@ int32 func__exit(){ exit_blocked=1; static int32 x; x=exit_value; - exit_value=0; + if (x) exit_value = 0; return x; } diff --git a/internal/c/parts/core/src/freeglut_main.c b/internal/c/parts/core/src/freeglut_main.c index c64f03dfa..67903a863 100644 --- a/internal/c/parts/core/src/freeglut_main.c +++ b/internal/c/parts/core/src/freeglut_main.c @@ -1323,8 +1323,8 @@ void FGAPIENTRY glutMainLoopEvent( void ) if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.DeleteWindow ) { GETWINDOW( xclient ); - - fgDestroyWindow ( window ); + qb64_custom_event(QB64_EVENT_CLOSE,0,0,0,0,0,0,0,0,NULL,NULL); + /* fgDestroyWindow ( window ); if( fgState.ActionOnWindowClose == GLUT_ACTION_EXIT ) { @@ -1333,8 +1333,8 @@ void FGAPIENTRY glutMainLoopEvent( void ) } else if( fgState.ActionOnWindowClose == GLUT_ACTION_GLUTMAINLOOP_RETURNS ) fgState.ExecState = GLUT_EXEC_STATE_STOP; - return; + */ } break;