From e1655f53941ff58983de147ddb0c64409e09a92c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 2 Jul 2014 13:28:29 +0000 Subject: [PATCH] Stop duplicating wxFrame dtor in all ports. wxGTK1, wxGTK, wxMSW and wxOSX all did the same thing in their wxFrame dtor, so just do it in wxFrameBase instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/frame.h | 2 -- include/wx/gtk1/frame.h | 2 -- include/wx/msw/frame.h | 2 -- include/wx/osx/frame.h | 2 -- src/common/framecmn.cpp | 4 +++- src/gtk/frame.cpp | 7 ------- src/gtk1/frame.cpp | 7 ------- src/msw/frame.cpp | 7 ------- src/osx/carbon/frame.cpp | 7 ------- 9 files changed, 3 insertions(+), 37 deletions(-) diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index abef72a19a..116efb6a5a 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -39,8 +39,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual ~wxFrame(); - #if wxUSE_STATUSBAR void SetStatusBar(wxStatusBar *statbar) wxOVERRIDE; #endif // wxUSE_STATUSBAR diff --git a/include/wx/gtk1/frame.h b/include/wx/gtk1/frame.h index 12d0984a64..5df008daba 100644 --- a/include/wx/gtk1/frame.h +++ b/include/wx/gtk1/frame.h @@ -50,8 +50,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual ~wxFrame(); - #if wxUSE_STATUSBAR virtual void PositionStatusBar(); diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 9a0639e818..a2ba91f760 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -37,8 +37,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual ~wxFrame(); - // implement base class pure virtuals virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); diff --git a/include/wx/osx/frame.h b/include/wx/osx/frame.h index 5902dc0c9c..5c804a54e8 100644 --- a/include/wx/osx/frame.h +++ b/include/wx/osx/frame.h @@ -43,8 +43,6 @@ public: long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); - virtual ~wxFrame(); - // implementation only from now on // ------------------------------- diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 614acd740c..2633351ff6 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -165,7 +165,9 @@ wxFrameBase::wxFrameBase() wxFrameBase::~wxFrameBase() { - // this destructor is required for Darwin + SendDestroyEvent(); + + DeleteAllBars(); } wxFrame *wxFrameBase::New(wxWindow *parent, diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 3f7ab5ab1d..20616f0ffb 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -56,13 +56,6 @@ bool wxFrame::Create( wxWindow *parent, return wxFrameBase::Create(parent, id, title, pos, sizeOrig, style, name); } -wxFrame::~wxFrame() -{ - SendDestroyEvent(); - - DeleteAllBars(); -} - // ---------------------------------------------------------------------------- // overridden wxWindow methods // ---------------------------------------------------------------------------- diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index ba31a23433..d4f3823e58 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -224,13 +224,6 @@ bool wxFrame::Create( wxWindow *parent, return rt; } -wxFrame::~wxFrame() -{ - SendDestroyEvent(); - - DeleteAllBars(); -} - // ---------------------------------------------------------------------------- // overridden wxWindow methods // ---------------------------------------------------------------------------- diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index d83b52e725..cfdca7e961 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -135,13 +135,6 @@ bool wxFrame::Create(wxWindow *parent, return true; } -wxFrame::~wxFrame() -{ - SendDestroyEvent(); - - DeleteAllBars(); -} - // ---------------------------------------------------------------------------- // wxFrame client size calculations // ---------------------------------------------------------------------------- diff --git a/src/osx/carbon/frame.cpp b/src/osx/carbon/frame.cpp index 72960b3b8d..0308c4bd59 100644 --- a/src/osx/carbon/frame.cpp +++ b/src/osx/carbon/frame.cpp @@ -55,13 +55,6 @@ bool wxFrame::Create(wxWindow *parent, return true; } -wxFrame::~wxFrame() -{ - SendDestroyEvent(); - - DeleteAllBars(); -} - // get the origin of the client area in the client coordinates wxPoint wxFrame::GetClientAreaOrigin() const {