Made the memory debugger properly output the unfreed allocations
authorBenjamin Segovia <segovia.benjamin@gmail.com>
Fri, 17 Feb 2012 04:54:16 +0000 (04:54 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:15:19 +0000 (16:15 -0700)
backend/src/sys/alloc.cpp

index 67dcc15..55a315e 100644 (file)
@@ -62,6 +62,7 @@ namespace gbe
   /*! Store allocation information */
   struct MemDebugger {
     MemDebugger(void) : unfreedNum(0), allocNum(0) {}
+    ~MemDebugger(void) { this->dumpAlloc(); }
     void* insertAlloc(void *ptr, const char *file, const char *function, int line);
     void removeAlloc(void *ptr);
     void dumpAlloc(void);