Commit 1039a775 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Improve locking safety in IMalloc::HeapMinimize().

parent da5903e7
......@@ -363,17 +363,22 @@ static INT WINAPI IMalloc_fnDidAlloc(IMalloc *iface, void *mem)
*/
static void WINAPI IMalloc_fnHeapMinimize(IMalloc *iface)
{
TRACE("()\n");
BOOL spy_active = FALSE;
if(Malloc32.pSpy) {
EnterCriticalSection(&IMalloc32_SpyCS);
IMallocSpy_PreHeapMinimize(Malloc32.pSpy);
}
TRACE("()\n");
if(Malloc32.pSpy) {
IMallocSpy_PostHeapMinimize(Malloc32.pSpy);
LeaveCriticalSection(&IMalloc32_SpyCS);
}
if (Malloc32.pSpy)
{
EnterCriticalSection(&IMalloc32_SpyCS);
spy_active = TRUE;
IMallocSpy_PreHeapMinimize(Malloc32.pSpy);
}
if (spy_active)
{
IMallocSpy_PostHeapMinimize(Malloc32.pSpy);
LeaveCriticalSection(&IMalloc32_SpyCS);
}
}
static const IMallocVtbl VT_IMalloc32 =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment