[WIN32K] Check if the window being destroyed is currently tracked. (#103)
[reactos.git] / win32ss / user / ntuser / window.c
index b8a3b59..9c7627c 100644 (file)
@@ -381,6 +381,12 @@ DWORD FASTCALL IntGetWindowContextHelpId( PWND pWnd )
    return HelpId;
 }
 
+
+VOID
+FASTCALL
+IntRemoveTrackMouseEvent(
+    PDESKTOP pDesk);
+
 /***********************************************************************
  *           IntSendDestroyMsg
  */
@@ -422,6 +428,12 @@ static void IntSendDestroyMsg(HWND hWnd)
       {
          co_IntDestroyCaret(ti);
       }
+
+      /* If the window being destroyed is currently tracked... */
+      if (ti->rpdesk->spwndTrack == Window)
+      {
+          IntRemoveTrackMouseEvent(ti->rpdesk);
+      }
    }
 
    /* If the window being destroyed is the current clipboard owner... */