]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
fixed typo
[wxWidgets.git] / src / common / wincmn.cpp
index bd4ec6de1e3897b3def2d833a25709603bbdb86b..2801de986d8701fd34a32cee7fded582e7f4beff 100644 (file)
@@ -214,6 +214,8 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
 // common clean up
 wxWindowBase::~wxWindowBase()
 {
+    wxASSERT_MSG( GetCapture() != this, wxT("attempt to destroy window with mouse capture") );
+
     // FIXME if these 2 cases result from programming errors in the user code
     //       we should probably assert here instead of silently fixing them
 
@@ -1620,12 +1622,12 @@ struct WXDLLEXPORT wxWindowNext
 {
     wxWindow *win;
     wxWindowNext *next;
-} *wxWindow::ms_winCaptureNext = NULL;
+} *wxWindowBase::ms_winCaptureNext = NULL;
 
-void wxWindow::CaptureMouse()
+void wxWindowBase::CaptureMouse()
 {
     wxLogTrace(_T("mousecapture"), _T("CaptureMouse(0x%08x)"), this);
-
+    
     wxWindow *winOld = GetCapture();
     if ( winOld )
     {
@@ -1640,8 +1642,12 @@ void wxWindow::CaptureMouse()
     DoCaptureMouse();
 }
 
-void wxWindow::ReleaseMouse()
+void wxWindowBase::ReleaseMouse()
 {
+    wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(0x%08x)"), this);
+
+    wxASSERT_MSG( GetCapture() == this, wxT("attempt to release mouse, but this window hasn't captured it") )
+
     DoReleaseMouse();
 
     if ( ms_winCaptureNext )