From 7777a461c3bc3d22aba13525c53709c8d1121976 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 4 Mar 2003 12:18:31 +0000 Subject: [PATCH] reordering in destructor, cursor adaptions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 16 ++++++++++++++-- src/mac/window.cpp | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index ae6b85e810..e536644618 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -187,10 +187,23 @@ wxWindowMac::~wxWindowMac() gFocusWindow = NULL ; } + // CS: copied from MSW : + // VS: destroy children first and _then_ detach *this from its parent. + // If we'd do it the other way around, children wouldn't be able + // find their parent frame (see above). + DestroyChildren(); + if ( m_parent ) m_parent->RemoveChild(this); - DestroyChildren(); + // delete our drop target if we've got one +#if wxUSE_DRAG_AND_DROP + if ( m_dropTarget != NULL ) + { + delete m_dropTarget; + m_dropTarget = NULL; + } +#endif // wxUSE_DRAG_AND_DROP } // Constructor @@ -1491,7 +1504,6 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa return FALSE ; } -extern int wxBusyCursorCount ; static wxWindow *gs_lastWhich = NULL; bool wxWindowMac::MacSetupCursor( const wxPoint& pt) diff --git a/src/mac/window.cpp b/src/mac/window.cpp index ae6b85e810..e536644618 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -187,10 +187,23 @@ wxWindowMac::~wxWindowMac() gFocusWindow = NULL ; } + // CS: copied from MSW : + // VS: destroy children first and _then_ detach *this from its parent. + // If we'd do it the other way around, children wouldn't be able + // find their parent frame (see above). + DestroyChildren(); + if ( m_parent ) m_parent->RemoveChild(this); - DestroyChildren(); + // delete our drop target if we've got one +#if wxUSE_DRAG_AND_DROP + if ( m_dropTarget != NULL ) + { + delete m_dropTarget; + m_dropTarget = NULL; + } +#endif // wxUSE_DRAG_AND_DROP } // Constructor @@ -1491,7 +1504,6 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa return FALSE ; } -extern int wxBusyCursorCount ; static wxWindow *gs_lastWhich = NULL; bool wxWindowMac::MacSetupCursor( const wxPoint& pt)