Commit 48126471 authored by Francis Beaudet's avatar Francis Beaudet Committed by Alexandre Julliard

Fixed a major memory leak in the window management code.

parent 6cf348d7
...@@ -177,17 +177,17 @@ void WIN_ReleaseWndPtr(WND *wndPtr) ...@@ -177,17 +177,17 @@ void WIN_ReleaseWndPtr(WND *wndPtr)
/*Decrement destruction monitoring value*/ /*Decrement destruction monitoring value*/
wndPtr->irefCount--; wndPtr->irefCount--;
/* Check if it's time to release the memory*/
/* Check if it's time to release the memory*/ /* Check if it's time to release the memory*/
if(wndPtr->irefCount == 0 && !wndPtr->dwMagic) if(wndPtr->irefCount == 0 && !wndPtr->dwMagic)
{ {
/* Release memory */ /* Release memory */
USER_HEAP_FREE( wndPtr->hwndSelf); USER_HEAP_FREE( wndPtr->hwndSelf);
wndPtr->hwndSelf = 0;
} }
else if(wndPtr->irefCount < 0) else if(wndPtr->irefCount < 0)
{ {
/* This else if is useful to monitor the WIN_ReleaseWndPtr function */ /* This else if is useful to monitor the WIN_ReleaseWndPtr function */
TRACE_(win)("forgot a Lock on %p somewhere\n",wndPtr); ERR_(win)("forgot a Lock on %p somewhere\n",wndPtr);
} }
/*unlock all WND structures for thread safeness*/ /*unlock all WND structures for thread safeness*/
WIN_UnlockWnds(); WIN_UnlockWnds();
...@@ -516,7 +516,6 @@ static WND* WIN_DestroyWindow( WND* wndPtr ) ...@@ -516,7 +516,6 @@ static WND* WIN_DestroyWindow( WND* wndPtr )
wndPtr->pDriver->pDestroyWindow( wndPtr ); wndPtr->pDriver->pDestroyWindow( wndPtr );
DCE_FreeWindowDCE( wndPtr ); /* Always do this to catch orphaned DCs */ DCE_FreeWindowDCE( wndPtr ); /* Always do this to catch orphaned DCs */
WINPROC_FreeProc( wndPtr->winproc, WIN_PROC_WINDOW ); WINPROC_FreeProc( wndPtr->winproc, WIN_PROC_WINDOW );
wndPtr->hwndSelf = 0;
wndPtr->class->cWindows--; wndPtr->class->cWindows--;
wndPtr->class = NULL; wndPtr->class = NULL;
......
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