From f55bd4549596b34ef479151d235c37a7be4ee85f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 23 Dec 2012 18:52:10 +0400 Subject: [PATCH] Fix GC_win32_free_heap to prevent memory leak if USE_GLOBAL_ALLOC * os_dep.c (GC_win32_free_heap): Test GLOBAL_ALLOC_TEST instead of GC_no_win32_dlls to determine whether the memory is allocated using GlobalAlloc (only if MSWIN32). --- os_dep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep.c b/os_dep.c index 17e55820..df5ebdb0 100644 --- a/os_dep.c +++ b/os_dep.c @@ -2297,7 +2297,7 @@ void * os2_alloc(size_t bytes) GC_API void GC_CALL GC_win32_free_heap(void) { # ifndef CYGWIN32 - if (GC_no_win32_dlls) + if (GLOBAL_ALLOC_TEST) # endif { while (GC_n_heap_bases-- > 0) { -- 2.40.0