- Message Queue Fix, resolves a number of application regressions (Total Commander...
authorAlex Ionescu <aionescu@gmail.com>
Mon, 25 Jul 2005 23:19:12 +0000 (23:19 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 25 Jul 2005 23:19:12 +0000 (23:19 +0000)
svn path=/trunk/; revision=16727

reactos/subsys/win32k/ntuser/window.c

index 77f68d1..2b8b434 100644 (file)
@@ -1577,6 +1577,7 @@ IntCreateWindowEx(DWORD dwExStyle,
       IntSetMenu(WindowObject, hMenu, &MenuChanged);
     }
   WindowObject->MessageQueue = PsGetWin32Thread()->MessageQueue;
+  IntReferenceMessageQueue(WindowObject->MessageQueue);
   WindowObject->Parent = (ParentWindow ? ParentWindow->Self : NULL);
   if((OwnerWindow = IntGetWindowObject(OwnerWindowHandle)))
   {
@@ -2180,7 +2181,7 @@ NtUserDestroyWindow(HWND Wnd)
   if (Window->MessageQueue->CaptureWindow == Window->Self)
     Window->MessageQueue->CaptureWindow = NULL;
   IntUnLockMessageQueue(Window->MessageQueue);
-
+  IntDereferenceMessageQueue(Window->MessageQueue);
   /* Call hooks */
 #if 0 /* FIXME */
   if (HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hwnd, 0, TRUE))