]> granicus.if.org Git - gc/commitdiff
Fix GC_win32_free_heap to prevent memory leak if USE_GLOBAL_ALLOC
authorIvan Maidanski <ivmai@mail.ru>
Sun, 23 Dec 2012 14:52:10 +0000 (18:52 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 23 Dec 2012 14:52:10 +0000 (18:52 +0400)
* 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

index 17e55820e7c3dc530ef7e322fbf4b083e81f4baa..df5ebdb042eda48af309987a8f30eabf61da1259 100644 (file)
--- 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) {