Author: cazfi
Date: Tue Jun 23 17:38:42 2015
New Revision: 29183

URL: http://svn.gna.org/viewcvs/freeciv?rev=29183&view=rev
Log:
Free lookup_req_list() requirement list on exit

See patch #6093

Modified:
    branches/S2_5/server/ruleset.c

Modified: branches/S2_5/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/ruleset.c?rev=29183&r1=29182&r2=29183&view=diff
==============================================================================
--- branches/S2_5/server/ruleset.c      (original)
+++ branches/S2_5/server/ruleset.c      Tue Jun 23 17:38:42 2015
@@ -116,6 +116,8 @@
 static char *base_sections = NULL;
 static char *road_sections = NULL;
 
+static struct requirement_vector reqs_list;
+
 static bool load_rulesetdir(const char *rsdir, bool act);
 static struct section_file *openload_ruleset_file(const char *whichset,
                                                   const char *rsdir);
@@ -330,11 +332,10 @@
   const char *type, *name;
   int j;
   const char *filename;
-  static struct requirement_vector list;
 
   filename = secfile_name(file);
 
-  requirement_vector_reserve(&list, 0);
+  requirement_vector_reserve(&reqs_list, 0);
 
   for (j = 0; (type = secfile_lookup_str_default(file, NULL, "%s.%s%d.type",
                                                  sec, sub, j)); j++) {
@@ -416,7 +417,7 @@
       return NULL;
     }
 
-    requirement_vector_append(&list, req);
+    requirement_vector_append(&reqs_list, req);
   }
 
   if (j > MAX_NUM_REQS) {
@@ -426,7 +427,7 @@
     return NULL;
   }
 
-  return &list;
+  return &reqs_list;
 }
 
 /**************************************************************************
@@ -6065,6 +6066,7 @@
 void rulesets_deinit(void)
 {
   script_server_free();
+  requirement_vector_free(&reqs_list);
 }
 
 /**************************************************************************


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to