r3829 - in trunk/data/qcsrc: common server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Jul 15 03:45:40 EDT 2008
Author: div0
Date: 2008-07-15 03:45:35 -0400 (Tue, 15 Jul 2008)
New Revision: 3829
Modified:
trunk/data/qcsrc/common/mapinfo.qc
trunk/data/qcsrc/common/mapinfo.qh
trunk/data/qcsrc/server/g_world.qc
Log:
fix more leaks
Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc 2008-07-15 06:47:11 UTC (rev 3828)
+++ trunk/data/qcsrc/common/mapinfo.qc 2008-07-15 07:45:35 UTC (rev 3829)
@@ -1,4 +1,4 @@
- // internal toy
+// internal toy
void cvar_settemp(string pKey, string pValue)
{
//localcmd(strcat("\nsettemp ", t, " \"", s, "\"\n"));
@@ -238,6 +238,15 @@
MapInfo_ClearTemps();
return 1;
}
+
+void MapInfo_Filter_Free()
+{
+ if(_MapInfo_filtered)
+ {
+ strunzone(_MapInfo_filtered);
+ _MapInfo_filtered = string_null;
+ }
+}
#else
float _MapInfo_filtered;
float _MapInfo_filtered_allocated;
@@ -271,6 +280,15 @@
MapInfo_ClearTemps();
return 1;
}
+
+void MapInfo_Filter_Free()
+{
+ if(_MapInfo_filtered_allocated)
+ {
+ buf_del(_MapInfo_filtered);
+ _MapInfo_filtered_allocated = 0;
+ }
+}
#endif
// load info about the i-th map into the MapInfo_Map_* globals
@@ -829,3 +847,16 @@
MapInfo_Map_supportedGametypes = 0;
MapInfo_Map_supportedFeatures = 0;
}
+
+void MapInfo_Shutdown()
+{
+ MapInfo_ClearTemps();
+ MapInfo_Filter_Free();
+ MapInfo_Cache_Destroy();
+ if(_MapInfo_globopen)
+ {
+ search_end(_MapInfo_globhandle);
+ _MapInfo_globhandle = -1;
+ _MapInfo_globopen = FALSE;
+ }
+}
Modified: trunk/data/qcsrc/common/mapinfo.qh
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qh 2008-07-15 06:47:11 UTC (rev 3828)
+++ trunk/data/qcsrc/common/mapinfo.qh 2008-07-15 07:45:35 UTC (rev 3829)
@@ -64,3 +64,5 @@
void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
+
+void MapInfo_Shutdown(); // call this in the shutdown handler
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2008-07-15 06:47:11 UTC (rev 3828)
+++ trunk/data/qcsrc/server/g_world.qc 2008-07-15 07:45:35 UTC (rev 3829)
@@ -2531,9 +2531,12 @@
Ban_SaveBans();
if(!sv_cheats)
db_save(ServerProgsDB, "server.db");
+ db_close(ServerProgsDB);
print("done!\n");
// tell the bot system the game is ending now
bot_endgame();
+
+ MapInfo_Shutdown();
}
else
{
More information about the nexuiz-commits
mailing list