From b4ab81bedb237ddbf81675531e0c58b07ad6b07b Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Wed, 12 Aug 2020 14:54:08 +0000 Subject: [PATCH] sys: Initialize the memory subsystem in main() git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12896 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 3 --- sys_sdl.c | 3 +++ sys_unix.c | 4 ++++ sys_win.c | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/host.c b/host.c index 35d84307..c9a0ca3f 100644 --- a/host.c +++ b/host.c @@ -659,9 +659,6 @@ static void Host_Init (void) if (COM_CheckParm("-nostdout")) sys_nostdout = 1; - // used by everything - Memory_Init(); - // initialize console command/cvar/alias/command execution systems Cmd_Init(); diff --git a/sys_sdl.c b/sys_sdl.c index 8667f722..50186991 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -220,6 +220,9 @@ int main (int argc, char *argv[]) // we don't know which systems we'll want to init, yet... SDL_Init(0); + // used by everything + Memory_Init(); + Host_Main(); Sys_Quit(0); diff --git a/sys_unix.c b/sys_unix.c index 70e4bd56..7fdd1df9 100644 --- a/sys_unix.c +++ b/sys_unix.c @@ -164,6 +164,10 @@ int main (int argc, char **argv) #ifndef WIN32 fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NONBLOCK); #endif + + // used by everything + Memory_Init(); + Host_Main(); Sys_Quit(0); diff --git a/sys_win.c b/sys_win.c index 12b4174a..8ddf7e90 100644 --- a/sys_win.c +++ b/sys_win.c @@ -361,6 +361,9 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin Sys_ProvideSelfFD(); + // used by everything + Memory_Init(); + Host_Main(); Sys_Quit(0); -- 2.39.2