pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] r3929 - trunk/pingus/src


From: grumbel at BerliOS
Subject: [Pingus-CVS] r3929 - trunk/pingus/src
Date: Tue, 29 Jul 2008 02:13:39 +0200

Author: grumbel
Date: 2008-07-29 02:13:39 +0200 (Tue, 29 Jul 2008)
New Revision: 3929

Modified:
   trunk/pingus/src/memory_pool.hpp
Log:
Fixed issue with clear()

Modified: trunk/pingus/src/memory_pool.hpp
===================================================================
--- trunk/pingus/src/memory_pool.hpp    2008-07-29 00:13:02 UTC (rev 3928)
+++ trunk/pingus/src/memory_pool.hpp    2008-07-29 00:13:39 UTC (rev 3929)
@@ -76,9 +76,17 @@
   {
     for(typename Objects::reverse_iterator i = objects.rbegin(); i != 
objects.rend(); ++i)
       (*i)->~T();
+    objects.clear();
 
+    // FIXME: We don't have to delete the chunks, instead we should
+    // just reset the pointer to start and reuse them
     for(typename Chunks::reverse_iterator i = chunks.rbegin(); i != 
chunks.rend(); ++i)
-      delete[] *i;
+      {
+        delete[] *i;
+      }
+    chunks.clear();
+
+    next_free = 0;
   }
 
   template<class C> 





reply via email to

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