diff --git a/memory/heap.c b/memory/heap.c index e4755abd292..6b00960c255 100644 --- a/memory/heap.c +++ b/memory/heap.c @@ -508,7 +508,12 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags, /* Initialize critical section */ InitializeCriticalSection( &heap->critSection ); - if (!SystemHeap) HEAP_SystemLock = &heap->critSection; + if (!SystemHeap) + { + HEAP_SystemLock = &heap->critSection; + /* System heap critical section has to be global */ + MakeCriticalSectionGlobal( &heap->critSection ); + } } /* Create the first free block */