From c3e9cd9c91748d9cb0a0ea181707783a314b9d2f Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sat, 3 Jul 2004 00:16:39 +0000 Subject: [PATCH] - Should fix mem leak with ZEND_MM. I made this change a while ago and - rolled it back but I don't remember why. Please test! --- Zend/zend_alloc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 9b7585693ef..0fabed4dd2e 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -496,10 +496,12 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC) #endif /* !ZEND_DISABLE_MEMORY_CACHE */ #if defined(ZEND_MM) && !ZEND_DEBUG + zend_mm_shutdown(&AG(mm_heap)); if (full_shutdown) { - zend_mm_shutdown(&AG(mm_heap)); return; } + zend_mm_startup(&AG(mm_heap), 256*1024); + #elif defined(ZEND_WIN32) && !ZEND_DEBUG if (full_shutdown && AG(memory_heap)) { HeapDestroy(AG(memory_heap)); @@ -621,10 +623,11 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC) #endif #if defined(ZEND_MM) && ZEND_DEBUG + zend_mm_shutdown(&AG(mm_heap)); if (full_shutdown) { - zend_mm_shutdown(&AG(mm_heap)); return; } + zend_mm_startup(&AG(mm_heap), 256*1024); #elif defined(ZEND_WIN32) && ZEND_DEBUG if (full_shutdown && AG(memory_heap)) { HeapDestroy(AG(memory_heap));