diff --git a/reactos/subsys/win32k/include/msgqueue.h b/reactos/subsys/win32k/include/msgqueue.h index 6a51d017f7e..d9e7eeb7a80 100644 --- a/reactos/subsys/win32k/include/msgqueue.h +++ b/reactos/subsys/win32k/include/msgqueue.h @@ -239,6 +239,8 @@ VOID STDCALL MsqRemoveWindowMessagesFromQueue(PVOID pWindow); /* F*(&$ headers, if(InterlockedDecrement(&(MsgQueue)->References) == 0) \ { \ DPRINT("Free message queue 0x%x\n", (MsgQueue)); \ + if ((MsgQueue)->NewMessages != NULL) \ + ObDereferenceObject((MsgQueue)->NewMessages); \ if ((MsgQueue)->NewMessagesHandle != NULL) \ ZwClose((MsgQueue)->NewMessagesHandle); \ ExFreePool((MsgQueue)); \