]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Fix Cygwin and MinGW compilation
[wxWidgets.git] / src / common / wincmn.cpp
index 0f7a0231e31f02e74279726d82b094e1d4ee4422..f1b4b5ef7c0461af924d3d232de55e9218ee7340 100644 (file)
@@ -152,6 +152,7 @@ void wxWindowBase::InitBase()
     m_constraints = (wxLayoutConstraints *) NULL;
     m_constraintsInvolvedIn = (wxWindowList *) NULL;
     m_windowSizer = (wxSizer *) NULL;
+    m_containingSizer = (wxSizer *) NULL;
     m_autoLayout = FALSE;
 #endif // wxUSE_CONSTRAINTS
 
@@ -257,6 +258,9 @@ wxWindowBase::~wxWindowBase()
         m_constraints = NULL;
     }
 
+    if ( m_containingSizer )
+        m_containingSizer->Remove((wxWindow*)this);
+
     if ( m_windowSizer )
         delete m_windowSizer;
 
@@ -1704,7 +1708,8 @@ void wxWindowBase::CaptureMouse()
     wxWindow *winOld = GetCapture();
     if ( winOld )
     {
-       winOld->DoReleaseMouse();
+        ((wxWindowBase*) winOld)->DoReleaseMouse();
+       
         // save it on stack
         wxWindowNext *item = new wxWindowNext;
         item->win = winOld;
@@ -1726,8 +1731,8 @@ void wxWindowBase::ReleaseMouse()
 
     if ( ms_winCaptureNext )
     {
-        ms_winCaptureNext->win->DoCaptureMouse();
-
+        ((wxWindowBase*)ms_winCaptureNext->win)->DoCaptureMouse();
+       
         wxWindowNext *item = ms_winCaptureNext;
         ms_winCaptureNext = item->next;
         delete item;