pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.38,1.39 manage


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldmap manager.cxx,1.38,1.39 manager.hxx,1.21,1.22 path_graph.cxx,1.21,1.22 path_graph.hxx,1.10,1.11 worldmap.cxx,1.47,1.48
Date: 4 Jun 2003 17:22:35 -0000

Update of /var/lib/cvs/Games/Pingus/src/worldmap
In directory dark:/tmp/cvs-serv16368/src/worldmap

Modified Files:
        manager.cxx manager.hxx path_graph.cxx path_graph.hxx 
        worldmap.cxx 
Log Message:
cleanup / memory leak fixes by Henri Manson


Index: manager.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/manager.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- manager.cxx 24 Apr 2003 15:18:19 -0000      1.38
+++ manager.cxx 4 Jun 2003 17:22:33 -0000       1.39
@@ -340,6 +340,11 @@
     return instance_ = new WorldMapManager ();
 }
 
+void WorldMapManager::deinit()
+{
+       delete instance_;
+}
+
 } // namespace WorldMapNS
 
 /* EOF */

Index: manager.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/manager.hxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- manager.hxx 19 Apr 2003 10:23:19 -0000      1.21
+++ manager.hxx 4 Jun 2003 17:22:33 -0000       1.22
@@ -106,7 +106,7 @@
 
   /** Singleton access function */
   static WorldMapManager* instance ();
-
+  static void deinit();
 private:
   /** Startup Hook of the Screen */
   void on_startup ();

Index: path_graph.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/path_graph.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- path_graph.cxx      19 Apr 2003 10:23:19 -0000      1.21
+++ path_graph.cxx      4 Jun 2003 17:22:33 -0000       1.22
@@ -66,6 +66,16 @@
     *i = 0;
 }
 
+void delete_Path(Edge<Path*> x)
+{
+       delete x.data;
+}
+
+PathGraph::~PathGraph()
+{
+       graph.for_each_edge(delete_Path);
+}
+
 void
 PathGraph::parse_nodes(xmlDocPtr doc, xmlNodePtr cur)
 {

Index: path_graph.hxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/path_graph.hxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- path_graph.hxx      19 Apr 2003 10:23:19 -0000      1.10
+++ path_graph.hxx      4 Jun 2003 17:22:33 -0000       1.11
@@ -62,6 +62,8 @@
       drawables into the world */
   PathGraph(WorldMap* worldmap, xmlDocPtr doc, xmlNodePtr cur);
 
+  ~PathGraph();
+
   /** @return a list of positions to walk to reach node \a end, by
       starting from \a start */
   PathfinderResult get_path(NodeId start, NodeId end);

Index: worldmap.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/worldmap/worldmap.cxx,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- worldmap.cxx        24 Apr 2003 15:18:19 -0000      1.47
+++ worldmap.cxx        4 Jun 2003 17:22:33 -0000       1.48
@@ -106,12 +106,22 @@
   add_drawable(pingus);
 
   levelname_bg = PingusResource::load_surface("worldmap/levelname_bg", "core");
+  xmlFreeDoc(doc);
 }
 
 WorldMap::~WorldMap()
 {
-  //delete pingus;
-  //delete path_graph;
+  for (DrawableLst::iterator i = drawables.begin (); i != drawables.end (); 
++i)
+    {
+      delete (*i);
+    }
+//  for (ObjectLst::iterator j = objects.begin (); j != objects.end (); ++j)
+//    {
+//      delete (*j);
+//    }
+
+//  delete pingus;
+  delete path_graph;
 }
 
 void





reply via email to

[Prev in Thread] Current Thread [Next in Thread]