Commit a02976d2327b88ef82dba266ef11d763cffa8735

David Turner 2002-03-20T15:37:12

* src/base/ftdbgmem.c (ft_mem_table_destroy): fixed a small bug that caused the library to crash with Electric Fence when memory debugging is used..

diff --git a/ChangeLog b/ChangeLog
index 0477ee9..7ad82b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
         allocation bug that was due to un-careful renaming of the FT_SubGlyph
         type..
 
+        * src/base/ftdbgmem.c (ft_mem_table_destroy): fixed a small bug that
+        caused the library to crash with Electric Fence when memory debugging
+        is used..
+
         * renaming stream macros. Examples:
         
            FILE_Skip    => FT_STREAM_SKIP
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index be2d910..b289648 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -324,13 +324,14 @@
 
       table->size   = 0;
       table->nodes  = 0;
-      free( table );
 
       printf(
         "FreeType: total memory allocations = %ld\n", table->alloc_total );
       printf(
         "FreeType: maximum memory footprint = %ld\n", table->alloc_max );
 
+      free( table );
+
       if ( leak_count > 0 )
         ft_mem_debug_panic(
           "FreeType: %ld bytes of memory leaked in %ld blocks\n",