summaryrefslogtreecommitdiff
path: root/src/doom
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom')
-rw-r--r--src/doom/d_main.c5
-rw-r--r--src/doom/d_net.c4
-rw-r--r--src/doom/s_sound.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index a7fed952..c84783bc 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -950,6 +950,9 @@ void D_DoomMain (void)
printf (DEH_String("M_LoadDefaults: Load system defaults.\n"));
M_LoadDefaults (); // load before initing other systems
+ // Save configuration at exit.
+ I_AtExit(M_SaveDefaults, false);
+
printf (DEH_String("W_Init: Init WADfiles.\n"));
D_AddFile(iwadfile);
@@ -1193,6 +1196,8 @@ void D_DoomMain (void)
}
+ I_AtExit((atexit_func_t) G_CheckDemoStatus, true);
+
// Generate the WAD hash table. Speed things up a bit.
W_GenerateHashTable();
diff --git a/src/doom/d_net.c b/src/doom/d_net.c
index 4e87a813..8f75fd06 100644
--- a/src/doom/d_net.c
+++ b/src/doom/d_net.c
@@ -237,6 +237,10 @@ void D_CheckNetGame (void)
int i;
int num_players;
+ // Call D_QuitNetGame on exit
+
+ I_AtExit(D_QuitNetGame, true);
+
// default values for single player
consoleplayer = 0;
diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c
index 964ed27f..fa236970 100644
--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -147,6 +147,8 @@ void S_Init(int sfxVolume, int musicVolume)
{
S_sfx[i].lumpnum = S_sfx[i].usefulness = -1;
}
+
+ I_AtExit(S_Shutdown, true);
}
void S_Shutdown(void)