use destructor attribute for W_Shutdown
makes sure this is always called in any case also just simpler
This commit is contained in:
1 parent
f8f178e9d3
commit
989f404ea2
4 files changed
+1
-11
No files matched your search
@@ -1464,7 +1464,6 @@ void I_Quit(void)
|
||||
free(myargv); // Deallocate allocated memory
|
||||
|
||||
death:
|
||||
W_Shutdown();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -1510,7 +1509,6 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
|
||||
I_OutputMsg("SRB2Kart %s Recursive Error", buffer);
|
||||
|
||||
W_Shutdown();
|
||||
exit(-1); // recursive errors detected
|
||||
}
|
||||
}
|
||||
@@ -1545,8 +1543,6 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
I_ShutdownGraphics();
|
||||
I_ShutdownSystem();
|
||||
|
||||
W_Shutdown();
|
||||
|
||||
#if defined (PARANOIA) && defined (__CYGWIN__)
|
||||
*(INT32 *)2 = 4; //Alam: Debug!
|
||||
#endif
|
||||
|
||||
@@ -2025,7 +2025,6 @@ FUNCNORETURN void ATTRNORETURN I_Quit(void)
|
||||
if (myargmalloc)
|
||||
free(myargv); // Deallocate allocated memory
|
||||
|
||||
W_Shutdown();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -2085,7 +2084,6 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
sigttl = "SRB2Kart " VERSIONSTRING " Recursive Error";
|
||||
I_ShowSimpleErrorBox(sigttl, buffer);
|
||||
|
||||
W_Shutdown();
|
||||
exit(-1); // recursive errors detected
|
||||
}
|
||||
}
|
||||
@@ -2127,8 +2125,6 @@ FUNCIERROR void ATTRNORETURN I_Error(const char *error, ...)
|
||||
//I_ShowSimpleErrorBox(sigttl, buffer);
|
||||
I_ShowErrorBox(sigttl, buffer);
|
||||
|
||||
W_Shutdown();
|
||||
|
||||
#if defined (PARANOIA) && defined (__CYGWIN__)
|
||||
*(INT32 *)2 = 4; //Alam: Debug!
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ wadfile_t *wadfiles[MAX_WADFILES] = {}; // 0 to numwadfiles-1 are valid
|
||||
// If not done on a Mac then open wad files
|
||||
// can prevent removable media they are on from
|
||||
// being ejected
|
||||
void W_Shutdown(void)
|
||||
DESTRUCTOR static void W_Shutdown(void)
|
||||
{
|
||||
lumpnum_map_cleanup(&lumpnumcache);
|
||||
|
||||
|
||||
@@ -154,8 +154,6 @@ extern wadfile_t *wadfiles[MAX_WADFILES];
|
||||
|
||||
// =========================================================================
|
||||
|
||||
void W_Shutdown(void);
|
||||
|
||||
// Opens a WAD file. Returns the FILE * handle for the file, or NULL if not found or could not be opened
|
||||
FILE *W_OpenWadFile(const char **filename, boolean useerrors);
|
||||
// Load and add a wadfile to the active wad files, returns numbers of lumps, INT16_MAX on error
|
||||
|
||||
Reference in new issue
Block a user