set m_isBeingDeleted to true (only) in SendDestroyEvent(); call it as early as possib...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Jan 2009 18:33:33 +0000 (18:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Jan 2009 18:33:33 +0000 (18:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

42 files changed:
include/wx/msw/control.h
include/wx/os2/control.h
include/wx/osx/control.h
include/wx/window.h
src/aui/auibook.cpp
src/cocoa/window.mm
src/common/wincmn.cpp
src/dfb/nonownedwnd.cpp
src/dfb/window.cpp
src/gtk/dialog.cpp
src/gtk/frame.cpp
src/gtk/toplevel.cpp
src/gtk/window.cpp
src/gtk1/frame.cpp
src/gtk1/toplevel.cpp
src/gtk1/window.cpp
src/mgl/window.cpp
src/motif/dialog.cpp
src/motif/frame.cpp
src/motif/window.cpp
src/msw/control.cpp
src/msw/dialog.cpp
src/msw/frame.cpp
src/msw/radiobox.cpp
src/msw/toplevel.cpp
src/msw/window.cpp
src/os2/control.cpp
src/os2/dialog.cpp
src/os2/frame.cpp
src/os2/radiobox.cpp
src/os2/window.cpp
src/osx/carbon/control.cpp
src/osx/carbon/drawer.cpp
src/osx/carbon/frame.cpp
src/osx/dialog_osx.cpp
src/osx/nonownedwnd_osx.cpp
src/osx/radiobox_osx.cpp
src/osx/window_osx.cpp
src/palmos/control.cpp
src/univ/dialog.cpp
src/univ/winuniv.cpp
src/x11/window.cpp

index 20d9c73d5b233702400b5c3198da706bbab8f558..3288843c97d6b57c627270c399b36c63a3b7b00e 100644 (file)
@@ -35,7 +35,6 @@ public:
             const wxValidator& validator = wxDefaultValidator,
             const wxString& name = wxControlNameStr);
 
-    virtual ~wxControl();
 
     // Simulates an event
     virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
index dd7076542e7faf0527696c67026a26ef8424e69c..0fc4ceeba5bb70f030183291e0c5e308182ae198 100644 (file)
@@ -32,7 +32,6 @@ public:
     {
         Create( pParent, vId, rPos, rSize, lStyle, rValidator, rsName );
     }
-    virtual ~wxControl();
 
     bool Create( wxWindow*          pParent
                 ,wxWindowID         vId
index 8d7f2652c378f1cd03e3be6ee5bd61554020f8aa..123ab775547cf2d31616f5076cfaf71a7c82f666 100644 (file)
@@ -35,7 +35,6 @@ public:
             const wxSize& size = wxDefaultSize, long style = 0,
             const wxValidator& validator = wxDefaultValidator,
             const wxString& name = wxControlNameStr);
-   virtual ~wxControl();
 
    // Simulates an event
    virtual void Command(wxCommandEvent& event) { ProcessCommand(event); }
index 04b443a1a46bb4c71f39b116bc51d1aea6172c18..3a626d5a881e61524180686bd9d23c25c02b1271 100644 (file)
@@ -1402,7 +1402,8 @@ protected:
     void SatisfyConstraints();
 #endif // wxUSE_CONSTRAINTS
 
-    // Send the wxWindowDestroyEvent
+    // Send the wxWindowDestroyEvent if not done yet and sets m_isBeingDeleted
+    // to true
     void SendDestroyEvent();
 
     // returns the main window of composite control; this is the window
index 607722c11549a4ff85b87efc5fe43fd0ce253ade..690acc096b21abc6baf9e410835cf5e834e32bf8 100644 (file)
@@ -2898,7 +2898,7 @@ void wxAuiNotebook::InitNotebook(long style)
 wxAuiNotebook::~wxAuiNotebook()
 {
     // Indicate we're deleting pages
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     while ( GetPageCount() > 0 )
         DeletePage(0);
index 5b54eb71a456bb0757db0f9eab9455dfdab299d8..3cee0cb9b7058948eaf8d5859119e8f1dc0c61f8 100644 (file)
@@ -943,7 +943,6 @@ void wxWindowCocoa::Init()
     m_cocoaNSView = NULL;
     m_cocoaHider = NULL;
     m_wxCocoaScrollView = NULL;
-    m_isBeingDeleted = false;
     m_isInPaint = false;
     m_visibleTrackingRectManager = NULL;
 }
index 57a451efd581bc2d8de8add1fdd5d6d7e492b5a3..5192410234d5a8b0c50300fd0106bf58fe0c24f9 100644 (file)
@@ -209,7 +209,9 @@ wxWindowBase::wxWindowBase()
     // Whether we're using the current theme for this window (wxGTK only for now)
     m_themeEnabled = false;
 
-    // VZ: this one shouldn't exist...
+    // This is set to true by SendDestroyEvent() which should be called by the
+    // most derived class to ensure that the destruction event is sent as soon
+    // as possible to allow its handlers to still see the undestroyed window
     m_isBeingDeleted = false;
 
     m_freezeCount = 0;
@@ -387,6 +389,16 @@ bool wxWindowBase::IsBeingDeleted() const
 
 void wxWindowBase::SendDestroyEvent()
 {
+    if ( m_isBeingDeleted )
+    {
+        // we could have been already called from a more derived class dtor,
+        // e.g. ~wxTLW calls us and so does ~wxWindow and the latter call
+        // should be simply ignored
+        return;
+    }
+
+    m_isBeingDeleted = true;
+
     wxWindowDestroyEvent event;
     event.SetEventObject(this);
     event.SetId(GetId());
index d77669378c8c0aa32c7aae08c04c767d394d7600..c455d5e4ffa1c9a9b3ff8082576279d64fb8280a 100644 (file)
@@ -153,7 +153,7 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
 
 wxNonOwnedWindow::~wxNonOwnedWindow()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // destroy all children before we destroy the underlying DirectFB window,
     // so that if any of them does something with the TLW, it will still work:
index cbc67d47773f8cabaab33fa5b7ec409b1e91d19f..548616b0fb7b449c2981cb8cb0207a20bbed2c6e 100644 (file)
@@ -88,8 +88,6 @@ wxWindowDFB::~wxWindowDFB()
 {
     SendDestroyEvent();
 
-    m_isBeingDeleted = true;
-
     if ( gs_mouseCapture == this )
         ReleaseMouse();
 
index 8c40909e05a48934dd86db91a7499a08c3de598d..01006829141fda0983f87c7cb485457855bbc336 100644 (file)
@@ -85,8 +85,6 @@ bool wxDialog::Show( bool show )
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
-
     // if the dialog is modal, this will end its event loop
     if ( IsModal() )
         EndModal(wxID_CANCEL);
index 118148b185df88eded61f1ddc1d8fd20714da2b4..2fb0d7c57a04b360a628f61701d87a390bf5cf74 100644 (file)
@@ -56,7 +56,8 @@ bool wxFrame::Create( wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 }
 
index caffefc1bc647d0c01a7792fc80bc02fbe2d4e65..8990d423040e489ee8d8e37457b7e96fab72f6f3 100644 (file)
@@ -665,7 +665,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
         RemoveGrab();
     }
 
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // it may also be GtkScrolledWindow in the case of an MDI child
     if (GTK_IS_WINDOW(m_widget))
index 9b0141293dfab4fcff04b9f4fe0d0d2e9d6a9686..c66ad433c2db2ba550a98db5883b20170e48e2db 100644 (file)
@@ -2040,9 +2040,8 @@ void wxWindowGTK::Init()
     m_height = 0;
 
     m_hasVMT = false;
-    m_isBeingDeleted = false;
 
-    m_showOnIdle= false;
+    m_showOnIdle = false;
 
     m_noExpose = false;
     m_nativeSizeEvent = false;
@@ -2210,7 +2209,6 @@ wxWindowGTK::~wxWindowGTK()
     if ( gs_deferredFocusOut == this )
         gs_deferredFocusOut = NULL;
 
-    m_isBeingDeleted = true;
     m_hasVMT = false;
 
     // destroy children before destroying this window itself
index 2e3f915bee712c6d74a50a401375bfc908cd319b..94e99c07a5e50fa3a9c0e2522ceaa37d50e9f71b 100644 (file)
@@ -229,7 +229,8 @@ bool wxFrame::Create( wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 }
 
index ccc04cf391ab375ba0efccfd45dbc54fa4864aad..370903718ba7cce779f85c2c99a741500aa8ccd8 100644 (file)
@@ -660,7 +660,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK()
         RemoveGrab();
     }
 
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // it may also be GtkScrolledWindow in the case of an MDI child
     if (GTK_IS_WINDOW(m_widget))
index 7061e1ee6b479b8a6dbb805bc791a99a6982bda4..ba93c71dd9f0d0461046363fb95d2f91f1d3bd47 100644 (file)
@@ -2437,7 +2437,6 @@ void wxWindowGTK::Init()
     m_sizeSet = false;
     m_hasVMT = false;
     m_needParent = true;
-    m_isBeingDeleted = false;
 
     m_noExpose = false;
     m_nativeSizeEvent = false;
@@ -2613,7 +2612,6 @@ wxWindowGTK::~wxWindowGTK()
     if ( g_delayedFocus == this )
         g_delayedFocus = NULL;
 
-    m_isBeingDeleted = true;
     m_hasVMT = false;
 
     // destroy children before destroying this window itself
index 5ad62e94e3ffebdc4f11d690b4f520f0f66131f6..275d2e801e922b883584f7dfa0d61b82a61cf9bb 100644 (file)
@@ -559,8 +559,6 @@ wxWindowMGL::~wxWindowMGL()
 {
     SendDestroyEvent();
 
-    m_isBeingDeleted = true;
-
     if ( gs_mouseCapture == this )
         ReleaseMouse();
 
index 3955a68d4536e6385f011764ffde4e670c3f7e42..347e11354cfeb7aacdfadb6d45fd2e24f0b86ae8 100644 (file)
@@ -181,7 +181,7 @@ void wxDialog::SetModal(bool flag)
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // if the dialog is modal, this will end its event loop
     Show(false);
index aa9c013680439b517876d70cb4591ae29d67b87e..c32ec0a0f4c5bbdbe128a8381e4c166e20bb6a60 100644 (file)
@@ -253,7 +253,7 @@ bool wxFrame::XmDoCreateTLW(wxWindow* WXUNUSED(parent),
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     if (m_clientArea)
     {
index 32f3dabc2eee7c3951ba4e533463e8a8fa73c909..116998f5a8dc43889162539bf8588f6b213a1697 100644 (file)
@@ -345,11 +345,11 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
 // Destructor
 wxWindow::~wxWindow()
 {
+    SendDestroyEvent();
+
     if (g_captureWindow == this)
         g_captureWindow = NULL;
 
-    m_isBeingDeleted = true;
-
     // Motif-specific actions first
     WXWidget wMain = GetMainWidget();
     if ( wMain )
index 745e9bd2a66cbd4aec8744dd4dfe17fd84690170..5c1740dfad2979409fd36c46fb5d43605d1130f7 100644 (file)
@@ -59,15 +59,6 @@ IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
 // wxControl implementation
 // ============================================================================
 
-// ----------------------------------------------------------------------------
-// wxControl ctor/dtor
-// ----------------------------------------------------------------------------
-
-wxControl::~wxControl()
-{
-    m_isBeingDeleted = true;
-}
-
 // ----------------------------------------------------------------------------
 // control window creation
 // ----------------------------------------------------------------------------
index c7baa0359ce37bf8b3ff19df32e861ff0f200555..55bd004088e09c714de08b0ffa72fc15d5b4b32f 100644 (file)
@@ -192,8 +192,6 @@ bool wxDialog::Create(wxWindow *parent,
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
-
     // this will also reenable all the other windows for a modal dialog
     Show(false);
 
index c81d5c65730c7fb1903e3c10777d07adf4efccbc..bf2b9dbac88a98330cdbed82c205faca4e662ae4 100644 (file)
@@ -209,7 +209,8 @@ bool wxFrame::Create(wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 }
 
index 26519adcbb6999bb9f0a7ac4c707d70cc5a37467..cdf514108516ca6659673b6f31121f45cfe9c54b 100644 (file)
@@ -254,7 +254,7 @@ bool wxRadioBox::Create(wxWindow *parent,
 
 wxRadioBox::~wxRadioBox()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     delete m_radioButtons;
     if ( m_dummyHwnd )
index 4ab30907af24e592f9df5fcdcc8d02c16d34f567..17392121160a0d1d9f3b05e74f7d948fd12fb69c 100644 (file)
@@ -599,6 +599,8 @@ bool wxTopLevelWindowMSW::Create(wxWindow *parent,
 
 wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
 {
+    SendDestroyEvent();
+
 #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
     SHACTIVATEINFO* info = (SHACTIVATEINFO*) m_activateInfo;
     delete info;
index ea0ffb19acf8b3864f18f12261df190de08777a0..3707a1bad723a588ff0669d463198f6b6bfe16e9 100644 (file)
@@ -518,7 +518,6 @@ bool wxWindowMSW::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
 void wxWindowMSW::Init()
 {
     // MSW specific
-    m_isBeingDeleted = false;
     m_oldWndProc = NULL;
     m_mouseInWindow = false;
     m_lastKeydownProcessed = false;
@@ -540,7 +539,7 @@ void wxWindowMSW::Init()
 // Destructor
 wxWindowMSW::~wxWindowMSW()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
 #ifndef __WXUNIVERSAL__
     // VS: make sure there's no wxFrame with last focus set to us:
@@ -3949,8 +3948,6 @@ bool wxWindowMSW::HandleCreate(WXLPCREATESTRUCT WXUNUSED_IN_WINCE(cs),
 
 bool wxWindowMSW::HandleDestroy()
 {
-    SendDestroyEvent();
-
     // delete our drop target if we've got one
 #if wxUSE_DRAG_AND_DROP
     if ( m_dropTarget != NULL )
index 0c53e236b9234cd18be7164ea879812b14db11b8..4bbf875564dd00106d1e093114802bb3affde969 100644 (file)
@@ -60,11 +60,6 @@ bool wxControl::Create( wxWindow*           pParent,
     return bRval;
 } // end of wxControl::Create
 
-wxControl::~wxControl()
-{
-    m_isBeingDeleted = true;
-}
-
 bool wxControl::OS2CreateControl( const wxChar* zClassname,
                                   const wxString& rsLabel,
                                   const wxPoint& rPos,
index 8a56bef583ca21a06023c5cb4c3b555893a38c93..0f299aaff56194660df7e6f42a1d398955dd63fe 100644 (file)
@@ -147,7 +147,7 @@ void wxDialog::SetModal(bool WXUNUSED(bFlag))
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // this will also reenable all the other windows for a modal dialog
     Show(false);
index 57db7ded2886b1dddc2f078598e5119812336fdb..cc78c86abe998e1fa03969b31009deaf7d94a901 100644 (file)
@@ -127,7 +127,8 @@ bool wxFrame::Create( wxWindow*       pParent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 } // end of wxFrame::~wxFrame
 
index 6b09f2264606d62d78942b13f6f6ab3bd797f631..19ff8a2bacf8024d6f0e3b33abfba5c7bef913ed 100644 (file)
@@ -76,7 +76,7 @@ wxRadioBox::wxRadioBox()
 
 wxRadioBox::~wxRadioBox()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     if (m_hWnd)
         wxRemoveHandleAssociation(this);
index 409b6117f6a7d802a4c2ce5c5c71ef765eeca3df..36548384d62cf83104383464598a4ee6a5f7662f 100644 (file)
@@ -334,7 +334,7 @@ void wxWindowOS2::Init()
 //
 wxWindowOS2::~wxWindowOS2()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     for (wxWindow* pWin = GetParent(); pWin; pWin = pWin->GetParent())
     {
index 00114ba89e1414d0eb04176196b7dfde52f4d30c..7f406f3a8bf86d4bc62b931d34f7654c8b4873bf 100644 (file)
@@ -63,11 +63,6 @@ bool wxControl::Create( wxWindow *parent,
     return rval;
 }
 
-wxControl::~wxControl()
-{
-    m_isBeingDeleted = true;
-}
-
 bool wxControl::ProcessCommand( wxCommandEvent &event )
 {
     // Tries:
index 36dc09de1ab568bae9db7a32532fae05d34c09c9..0af7609fe833e24efd8918501a22f95585e4e785 100644 (file)
@@ -4,7 +4,7 @@
 //              Drawer windows appear under their parent window and
 //              behave like a drawer, opening and closing to reveal
 //              content that does not need to be visible at all times.
-// Author:      Jason Bagley 
+// Author:      Jason Bagley
 // Modified by: Ryan Norton (To make it work :), plus bug fixes)
 // Created:     2004-30-01
 // RCS-ID:      $Id$
@@ -40,17 +40,17 @@ wxDrawerWindow::wxDrawerWindow()
 }
 
 wxDrawerWindow::~wxDrawerWindow()
-{ 
-    m_isBeingDeleted = TRUE;
-    this->Show(FALSE);
+{
+    SendDestroyEvent();
+    Show(FALSE);
 }
-    
+
 bool wxDrawerWindow::Create(wxWindow *parent,
  wxWindowID id, const wxString& title,
  wxSize size, wxDirection edge, const wxString& name)
 {
     wxASSERT_MSG(NULL != parent, wxT("wxDrawerWindows must be attached to a parent window."));
-       
+
     // Constrain the drawer size to the parent window.
     const wxSize parentSize(parent->GetClientSize());
     if (wxLEFT == edge || wxRIGHT == edge)
@@ -63,25 +63,25 @@ bool wxDrawerWindow::Create(wxWindow *parent,
         if (size.GetWidth() > parentSize.GetWidth())
             size.SetWidth(parentSize.GetWidth() - (kLeadingOffset + kTrailingOffset));
     }
-    
-    // Create the drawer window. 
+
+    // Create the drawer window.
     const wxPoint pos(0, 0);
     const wxSize dummySize(0,0);
     const long style = wxFRAME_DRAWER;
-    
+
     bool success  = wxNonOwnedWindow::Create(parent, id, pos, size, style, name);
     if (success)
     {
         // this->MacCreateRealWindow(pos, size, style, name);
         success = (GetWXWindow() != NULL);
     }
-    
+
     if (success)
     {
         // Use drawer brush.
         SetBackgroundColour( wxColour( wxMacCreateCGColorFromHITheme( kThemeBrushDrawerBackground ) ) );
         ::SetThemeWindowBackground((WindowRef)GetWXWindow(), kThemeBrushDrawerBackground, false);
-         
+
         // Leading and trailing offset are gaps from parent window edges
         // to where the drawer starts.
         ::SetDrawerOffsets((WindowRef)GetWXWindow() , kLeadingOffset, kTrailingOffset);
@@ -90,7 +90,7 @@ bool wxDrawerWindow::Create(wxWindow *parent,
         // Is there a better way to get the parent's WindowRef?
         wxTopLevelWindow* tlwParent = wxDynamicCast(parent, wxTopLevelWindow);
         if (NULL != tlwParent)
-        { 
+        {
             OSStatus status = ::SetDrawerParent((WindowRef) GetWXWindow(),
             (WindowRef)tlwParent->GetWXWindow());
             success = (noErr == status);
@@ -98,7 +98,7 @@ bool wxDrawerWindow::Create(wxWindow *parent,
         else
             success = false;
     }
-    
+
     return success && SetPreferredEdge(edge);
 }
 
@@ -152,15 +152,15 @@ OptionBits DirectionToWindowEdge(wxDirection direction)
         case wxTOP:
         edge = kWindowEdgeTop;
         break;
-        
+
         case wxBOTTOM:
         edge = kWindowEdgeBottom;
         break;
-        
+
         case wxRIGHT:
         edge = kWindowEdgeRight;
         break;
-        
+
         case wxLEFT:
         default:
         edge = kWindowEdgeLeft;
@@ -177,23 +177,23 @@ wxDirection WindowEdgeToDirection(OptionBits edge)
         case kWindowEdgeTop:
         direction = wxTOP;
         break;
-        
+
         case kWindowEdgeBottom:
         direction = wxBOTTOM;
         break;
-        
+
         case kWindowEdgeRight:
         direction = wxRIGHT;
         break;
-        
+
         case kWindowEdgeDefault: // store current preferred and return that here?
         case kWindowEdgeLeft:
         default:
         direction = wxLEFT;
         break;
     }
-    
+
     return direction;
 }
 
-#endif // defined( __WXMAC__ ) 
+#endif // defined( __WXMAC__ )
index 156212156959f3f1ec7898796ffd603ce3f75e32..cfa644637270610fddcfb03bd62c11bb533b0488 100644 (file)
@@ -61,7 +61,8 @@ bool wxFrame::Create(wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 }
 
@@ -362,7 +363,7 @@ void wxFrame::PositionToolBar()
     int cw, ch;
 
     GetSize( &cw , &ch ) ;
-            
+
     int statusX = 0 ;
     int statusY = 0 ;
 
index fabbf006871142fa909891f04e34508cf916b143..fbc3ce67e21b7a9daec0ca583aeadecf42cf7294 100644 (file)
@@ -71,7 +71,7 @@ void wxDialog::SetModal( bool flag )
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     // if the dialog is modal, this will end its event loop
     Show(false);
index d8b9e02ce7392fb6c64adc976b5a134404e8aa84..2a6f1cf0057a0404f444138f12e405ec4a14d3e0 100644 (file)
@@ -151,7 +151,7 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
 
 wxNonOwnedWindow::~wxNonOwnedWindow()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
     
     wxRemoveWXWindowAssociation( this ) ;
     
index f6dc751f7585721203cb0da7d1aff2d048597d3e..4ba2abf0193eb5d43041369849709ccf4d25e9f1 100644 (file)
@@ -52,7 +52,7 @@ wxRadioBox::wxRadioBox()
 
 wxRadioBox::~wxRadioBox()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
     wxRadioButton *next, *current;
 
@@ -411,7 +411,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
     totWidth  = GetColumnCount() * (maxWidth + charWidth);
 
     wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) ) ;
-    
+
     // change the width / height only when specified
     if ( width == wxDefaultCoord )
     {
@@ -502,7 +502,7 @@ wxSize wxRadioBox::DoGetBestSize() const
     wxSize sz = DoGetSizeFromClientSize( wxSize( totWidth, totHeight ) );
     totWidth = sz.x;
     totHeight = sz.y;
-    
+
     // optimum size is an additional 5 pt border to all sides
     totWidth += 10;
     totHeight += 10;
index ee64a5619842c01fd9c0cffd1dbac8ec920dd575..8231ba5bb3ffd5a8443b9363f1a64156e21a4f89 100644 (file)
@@ -141,8 +141,6 @@ wxWindowMac::~wxWindowMac()
 {
     SendDestroyEvent();
 
-    m_isBeingDeleted = true;
-
     MacInvalidateBorders() ;
 
 #ifndef __WXUNIVERSAL__
index 39033e863d4d3c87d377e345e2d8959f6ece8a15..66dd535de7b2720861c1229ee20e74003f1fef92 100644 (file)
@@ -77,8 +77,9 @@ void wxControl::Init()
 
 wxControl::~wxControl()
 {
+    SendDestroyEvent();
+
     SetLabel(wxEmptyString);
-    m_isBeingDeleted = true;
 
     DestroyChildren();
 
index c98a5e91ac581b5ac7ca314192e3992417e6d9de..3faf2f7800844cf081446dcd0c3232b731db867a 100644 (file)
@@ -53,8 +53,6 @@ void wxDialog::Init()
 
 wxDialog::~wxDialog()
 {
-    m_isBeingDeleted = true;
-
     // if the dialog is modal, this will end its event loop
     Show(false);
 
index f623137eea92fe5d9c21a15b2bde49b4c91192ad..41b166cc4d8032e0d1537e58d532b9c6d39bf734 100644 (file)
@@ -224,7 +224,7 @@ bool wxWindow::Create(wxWindow *parent,
 
 wxWindow::~wxWindow()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
 
 #if wxUSE_SCROLLBAR
     // clear pointers to scrollbar before deleting the children: they are
index 6cae3175d72ad30eb58bd3e2cdf935322565bfc5..521a80b64afea9041fb2034fa21a758d0fb97f98 100644 (file)
@@ -350,8 +350,6 @@ wxWindowX11::~wxWindowX11()
     if (g_captureWindow == this)
         g_captureWindow = NULL;
 
-    m_isBeingDeleted = true;
-
     DestroyChildren();
 
     if (m_clientWindow != m_mainWindow)