Fortify memory debugging (cont'd).

* src/base/ftdbgmem.c (FT_DumpMemory): Check for active debugger.
(ft_mem_table_destroy): Move `FT_DumpMemory` call from here...
(ft_mem_debug_done): ... to here.
This commit is contained in:
Alexei Podtelezhnikov 2021-09-08 12:18:23 -04:00
parent 63806aad9f
commit c350aac099
1 changed files with 4 additions and 6 deletions

View File

@ -310,8 +310,6 @@
FT_Long leaks = 0;
FT_DumpMemory( table->memory );
/* remove all blocks from the table, revealing leaked ones */
for ( i = 0; i < table->size; i++ )
{
@ -862,6 +860,8 @@
FT_MemTable table = (FT_MemTable)memory->user;
FT_DumpMemory( memory );
ft_mem_table_destroy( table );
memory->free = table->free;
@ -894,11 +894,9 @@
extern void
FT_DumpMemory( FT_Memory memory )
{
FT_MemTable table = (FT_MemTable)memory->user;
if ( table )
if ( memory->free == ft_mem_debug_free )
{
FT_MemTable table = (FT_MemTable)memory->user;
FT_MemSource* bucket = table->sources;
FT_MemSource* limit = bucket + FT_MEM_SOURCE_BUCKETS;
FT_MemSource* sources;