From 9fd471a56a8179d06755c368fd2550d23b7b7957 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 15 Sep 2011 17:03:29 +0000 Subject: [PATCH] Make uninitialization sequence more consistent across the editor code. It's always like this now: ExtUninit -> (writesetup, misc.) uninitengine -> (uninitsystem -> (uninit timers, mouse, ...)) exit() Some paths still lead to a plain exit(), like failures in cache1d.c or mdsprite.c git-svn-id: https://svn.eduke32.com/eduke32@2022 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 19 +++++++------------ polymer/eduke32/build/src/sdlayer.c | 1 - polymer/eduke32/source/astub.c | 3 ++- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index c27c89dd9..117162b89 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -760,12 +760,10 @@ CANCEL: } -// clearfilenames(); ExtUnInit(); -// uninitengine(); - uninitsystem(); +// clearfilenames(); + uninitengine(); -// not reached... // Bprintf("Memory status: %d(%d) bytes\n",cachesize,artsize); // Bprintf("%s\n",kensig); return(0); @@ -3964,7 +3962,8 @@ end_yax: ; { message("out of memory!"); ExtUnInit(); - uninitsystem(); +// clearfilenames(); + uninitengine(); exit(1); } @@ -6776,10 +6775,8 @@ CANCEL: ExtUnInit(); // clearfilenames(); - uninittimer(); - uninitinput(); -// uninitengine(); - uninitsystem(); + uninitengine(); + exit(0); } @@ -6814,10 +6811,8 @@ CANCEL: { initprintf("%d * %d not supported in this graphics mode\n",xdim,ydim); ExtUnInit(); - uninitinput(); - uninittimer(); - uninitsystem(); // clearfilenames(); + uninitengine(); exit(1); } diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index ab0c12021..44dca2ddf 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -374,7 +374,6 @@ int32_t initsystem(void) void uninitsystem(void) { uninitinput(); - uninitmouse(); uninittimer(); if (appicon) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2674a1915..ba2d6705c 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -8765,8 +8765,9 @@ int32_t ExtPreInit(int32_t argc,const char **argv) static int32_t osdcmd_quit(const osdfuncparm_t *parm) { UNREFERENCED_PARAMETER(parm); - clearfilenames(); + ExtUnInit(); +// clearfilenames(); uninitengine(); exit(0);