]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix memory leaks in server csqc
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 4 Apr 2009 13:02:13 +0000 (13:02 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 4 Apr 2009 13:02:13 +0000 (13:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8852 d7cf8633-e32d-0410-b094-e92efae38249

host.c
sv_main.c

diff --git a/host.c b/host.c
index c8521f2753dd8300bb9e44c05d0aca2f44612d95..eb2311fc1973517f21bacad837175098b97da51d 100644 (file)
--- a/host.c
+++ b/host.c
@@ -549,6 +549,14 @@ void Host_ShutdownServer(void)
 
        NetConn_CloseServerPorts();
 
+       if(sv.csqc_progdata)
+       {
+               Con_DPrintf("Unloading CSQC data.\n");
+               Mem_Free(sv.csqc_progdata);
+               if(sv.csqc_progdata_deflated)
+                       Mem_Free(sv.csqc_progdata_deflated);
+       }
+
        sv.active = false;
 //
 // clear structures
index 9fc0661004259b8519066c30c04eefeeda4e625f..be2111c0d4b6e48770cac9b365b5ad1058334ab0 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -2792,6 +2792,13 @@ void SV_SpawnServer (const char *server)
        //Cvar_SetValue ("skill", (float)current_skill);
        current_skill = (int)(skill.value + 0.5);
 
+       if(sv.csqc_progdata)
+       {
+               Con_DPrintf("Unloading CSQC data.\n");
+               Mem_Free(sv.csqc_progdata);
+               if(sv.csqc_progdata_deflated)
+                       Mem_Free(sv.csqc_progdata_deflated);
+       }
 //
 // set up the new server
 //