r3830 - in branches/nexuiz-2.0: . data/qcsrc/common data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Jul 15 04:52:28 EDT 2008


Author: div0
Date: 2008-07-15 04:52:15 -0400 (Tue, 15 Jul 2008)
New Revision: 3830

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
   branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qh
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
Log:
r3828 | div0 | 2008-07-15 08:47:11 +0200 (Tue, 15 Jul 2008) | 2 lines
fix string leak in teamplay.qc
r3829 | div0 | 2008-07-15 09:45:35 +0200 (Tue, 15 Jul 2008) | 2 lines
fix more leaks

Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2008-07-15 07:45:35 UTC (rev 3829)
+++ branches/nexuiz-2.0/.patchsets	2008-07-15 08:52:15 UTC (rev 3830)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825
+revisions_applied = 1-3760,3762-3773,3777-3778,3787-3788,3790-3790,3796-3804,3807-3808,3817-3817,3822-3825,3828-3829

Modified: branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2008-07-15 07:45:35 UTC (rev 3829)
+++ branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qc	2008-07-15 08:52:15 UTC (rev 3830)
@@ -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
@@ -819,3 +837,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: branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qh	2008-07-15 07:45:35 UTC (rev 3829)
+++ branches/nexuiz-2.0/data/qcsrc/common/mapinfo.qh	2008-07-15 08:52:15 UTC (rev 3830)
@@ -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: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-07-15 07:45:35 UTC (rev 3829)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2008-07-15 08:52:15 UTC (rev 3830)
@@ -2394,9 +2394,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
 	{

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2008-07-15 07:45:35 UTC (rev 3829)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2008-07-15 08:52:15 UTC (rev 3830)
@@ -341,8 +341,7 @@
 	} else {
 		versionmsg = "^2client version and server version are compatible.^8";
 	}
-	return strzone(versionmsg);
-
+	return versionmsg;
 }
 
 
@@ -449,8 +448,6 @@
 	if(timeoutStatus != 0)
 		s = strcat(s, "\n\n", getTimeoutText(1));
 
-	s = strzone(s);
-
 	if (g_grappling_hook)
 		s = strcat(s, "\n\n^8grappling hook is enabled, press 'e' to use it\n");
 
@@ -494,12 +491,8 @@
 	if(cvar("timelimit"))
 		s = strcat(s, "\n^8time limit: ^7", cvar_string("timelimit"), " minutes");
 
-	s = strzone(s);
-
 	centerprint(pl, s);
 	//sprint(pl, s);
-
-	strunzone(s);
 }
 
 




More information about the nexuiz-commits mailing list