diff options
Diffstat (limited to 'e-util/e-memory.c')
-rw-r--r-- | e-util/e-memory.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/e-util/e-memory.c b/e-util/e-memory.c index 0dc865225d..108a627076 100644 --- a/e-util/e-memory.c +++ b/e-util/e-memory.c @@ -307,6 +307,23 @@ e_memchunk_clean(MemChunk *m) ci = hi; while (ci) { if (ci->count == m->blocksize) { + MemChunkFreeNode *prev = NULL; + + f = m->free; + while (f) { + if (tree_search (ci, (void *) f) == 0) { + /* prune this node from our free-node list */ + if (prev) + prev->next = f->next; + else + m->free = f->next; + } else { + prev = f; + } + + f = f->next; + } + g_ptr_array_remove_fast(m->blocks, ci->base); g_free(ci->base); } |