From bf5228267ab38d0b376243d92827fe8cf39b5f04 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 31 Jan 2018 10:08:42 -0500 Subject: [PATCH] Calls to Disconnect or Unbind in destructors are not needed, if... ... it's either the source of the connection that is being destroyed, or other object (such as an ancestor window) transitively owning it and so causing it to be destroyed too; or, the sink is being destroyed, and that sink is a wxEvtHandler (which is always so for Disconnect, though not for Unbind in case Bind was passed a member function of a non-wxEvtHandler). wxWidgets takes care of erasing the connection in such cases. This removes most calls to Disconnect and Unbind. Many destructors shrank to nothing. Notably, in case of popup menu handling, the call to Disconnect is not removable because the object being destroyed is neither the source nor the sink. --- src/AudacityLogger.cpp | 51 +------------------------- src/AudacityLogger.h | 2 - src/HistoryWindow.cpp | 15 -------- src/HistoryWindow.h | 1 - src/LyricsWindow.cpp | 8 ---- src/LyricsWindow.h | 1 - src/MixerBoard.cpp | 11 ------ src/MixerBoard.h | 1 - src/PluginManager.cpp | 9 ----- src/Project.cpp | 18 --------- src/Project.h | 1 - src/Track.cpp | 2 +- src/TrackPanel.cpp | 14 ------- src/TranslatableStringArray.h | 9 ----- src/effects/Contrast.cpp | 8 ---- src/effects/Contrast.h | 1 - src/effects/Effect.cpp | 10 ----- src/prefs/KeyConfigPrefs.cpp | 31 ---------------- src/prefs/KeyConfigPrefs.h | 1 - src/toolbars/ToolManager.cpp | 24 ------------ src/tracks/ui/PlayIndicatorOverlay.cpp | 5 --- src/tracks/ui/Scrubbing.cpp | 12 ------ src/tracks/ui/Scrubbing.h | 1 - src/tracks/ui/SelectHandle.cpp | 9 ----- src/widgets/Meter.cpp | 29 --------------- src/widgets/Meter.h | 2 - src/widgets/PopupMenuTable.cpp | 2 + src/widgets/Ruler.cpp | 5 --- src/widgets/wxPanelWrapper.h | 5 --- 29 files changed, 4 insertions(+), 284 deletions(-) diff --git a/src/AudacityLogger.cpp b/src/AudacityLogger.cpp index 70d045958..0124cdbcc 100644 --- a/src/AudacityLogger.cpp +++ b/src/AudacityLogger.cpp @@ -57,11 +57,6 @@ AudacityLogger::AudacityLogger() mUpdated = false; } -AudacityLogger::~AudacityLogger() -{ - Destroy(); -} - void AudacityLogger::Flush() { if (mUpdated && mFrame && mFrame->IsShown()) { @@ -95,50 +90,6 @@ void AudacityLogger::DoLogText(const wxString & str) } } -void AudacityLogger::Destroy() -{ - if (mFrame) { - mFrame->Disconnect(LoggerID_Save, - wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(AudacityLogger::OnSave), - NULL, - this); - mFrame->Disconnect(LoggerID_Clear, - wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(AudacityLogger::OnClear), - NULL, - this); - mFrame->Disconnect(LoggerID_Close, - wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(AudacityLogger::OnClose), - NULL, - this); - - mFrame->Disconnect(LoggerID_Save, - wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(AudacityLogger::OnSave), - NULL, - this); - mFrame->Disconnect(LoggerID_Clear, - wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(AudacityLogger::OnClear), - NULL, - this); - mFrame->Disconnect(LoggerID_Close, - wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(AudacityLogger::OnClose), - NULL, - this); - - mFrame->Disconnect(wxEVT_CLOSE_WINDOW, - wxCloseEventHandler(AudacityLogger::OnCloseWindow), - NULL, - this); - - mFrame.reset(); - } -} - void AudacityLogger::Show(bool show) { // Hide the frame if created, otherwise do nothing @@ -272,7 +223,7 @@ void AudacityLogger::OnCloseWindow(wxCloseEvent & WXUNUSED(e)) // On the Mac, destroy the window rather than hiding it since the // log menu will override the root windows menu if there is no // project window open. - Destroy(); + mFrame.reset(); #else Show(false); #endif diff --git a/src/AudacityLogger.h b/src/AudacityLogger.h index 473460d94..407e8f58f 100644 --- a/src/AudacityLogger.h +++ b/src/AudacityLogger.h @@ -28,10 +28,8 @@ class AudacityLogger final : public wxEvtHandler, public wxLog { public: AudacityLogger(); - virtual ~AudacityLogger(); void Show(bool show = true); - void Destroy(); #if defined(EXPERIMENTAL_CRASH_REPORT) wxString GetLog(); diff --git a/src/HistoryWindow.cpp b/src/HistoryWindow.cpp index 016b6dcc1..1a8eb328b 100644 --- a/src/HistoryWindow.cpp +++ b/src/HistoryWindow.cpp @@ -152,21 +152,6 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager): this); } -HistoryWindow::~HistoryWindow() -{ - wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK, - wxCommandEventHandler(HistoryWindow::OnAudioIO), - NULL, - this); - - wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, - wxCommandEventHandler(HistoryWindow::OnAudioIO), - NULL, - this); - - mAvail->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(HistoryWindow::OnChar)); -} - void HistoryWindow::OnAudioIO(wxCommandEvent& evt) { evt.Skip(); diff --git a/src/HistoryWindow.h b/src/HistoryWindow.h index 7d4df5eb0..c7cd68d2c 100644 --- a/src/HistoryWindow.h +++ b/src/HistoryWindow.h @@ -28,7 +28,6 @@ class HistoryWindow final : public wxDialogWrapper { public: HistoryWindow(AudacityProject * parent, UndoManager *manager); - ~HistoryWindow(); void UpdateDisplay(); diff --git a/src/LyricsWindow.cpp b/src/LyricsWindow.cpp index a5b27a624..527d64c64 100644 --- a/src/LyricsWindow.cpp +++ b/src/LyricsWindow.cpp @@ -133,14 +133,6 @@ LyricsWindow::LyricsWindow(AudacityProject *parent): Center(); } -LyricsWindow::~LyricsWindow() -{ - mProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(LyricsWindow::OnTimer), - NULL, - this); -} - void LyricsWindow::OnCloseWindow(wxCloseEvent & WXUNUSED(event)) { this->Hide(); diff --git a/src/LyricsWindow.h b/src/LyricsWindow.h index 0c640f851..f39ba6cbe 100644 --- a/src/LyricsWindow.h +++ b/src/LyricsWindow.h @@ -23,7 +23,6 @@ class LyricsWindow final : public wxFrame { public: LyricsWindow(AudacityProject* parent); - virtual ~LyricsWindow(); LyricsPanel *GetLyricsPanel() { return mLyricsPanel; }; diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp index 37e726106..ea3a86bc2 100644 --- a/src/MixerBoard.cpp +++ b/src/MixerBoard.cpp @@ -934,17 +934,6 @@ MixerBoard::MixerBoard(AudacityProject* pProject, this); } -MixerBoard::~MixerBoard() -{ - // private data members - mMusicalInstruments.clear(); - - mProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(MixerBoard::OnTimer), - NULL, - this); -} - diff --git a/src/MixerBoard.h b/src/MixerBoard.h index 1f77eab3c..c5a7859a1 100644 --- a/src/MixerBoard.h +++ b/src/MixerBoard.h @@ -206,7 +206,6 @@ public: wxFrame* parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); - virtual ~MixerBoard(); void UpdatePrefs(); diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index 62c8a3742..d2616de73 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -423,7 +423,6 @@ class PluginRegistrationDialog final : public wxDialogWrapper public: // constructors and destructors PluginRegistrationDialog(wxWindow *parent, EffectType type); - virtual ~PluginRegistrationDialog(); private: void Populate(); @@ -501,14 +500,6 @@ PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType Populate(); } -PluginRegistrationDialog::~PluginRegistrationDialog() -{ - mEffects->Disconnect(wxEVT_KEY_DOWN, - wxKeyEventHandler(PluginRegistrationDialog::OnListChar), - NULL, - this); -} - void PluginRegistrationDialog::Populate() { //------------------------- Main section -------------------- diff --git a/src/Project.cpp b/src/Project.cpp index db0eaa14e..c77e09862 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1258,11 +1258,6 @@ AudacityProject::~AudacityProject() mTrackPanel->RemoveOverlay(mCursorOverlay.get()); mTrackPanel->RemoveOverlay(mIndicatorOverlay.get()); } - - wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, - wxCommandEventHandler(AudacityProject::OnCapture), - NULL, - this); } void AudacityProject::ApplyUpdatedTheme() @@ -2715,11 +2710,6 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event) #endif } - this->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(ViewInfo::OnTimer), - NULL, - &mViewInfo); - // Destroys this pSelf.reset(); mRuler = nullptr; @@ -6038,14 +6028,6 @@ AudacityProject::PlaybackScroller::PlaybackScroller(AudacityProject *project) this); } -AudacityProject::PlaybackScroller::~PlaybackScroller() -{ - mProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(PlaybackScroller::OnTimer), - NULL, - this); -} - void AudacityProject::PlaybackScroller::OnTimer(wxCommandEvent &event) { // Let other listeners get the notification diff --git a/src/Project.h b/src/Project.h index f6201e790..4d8faf62f 100644 --- a/src/Project.h +++ b/src/Project.h @@ -793,7 +793,6 @@ public: { public: explicit PlaybackScroller(AudacityProject *project); - ~PlaybackScroller(); enum class Mode { Off, diff --git a/src/Track.cpp b/src/Track.cpp index 894b27f6b..3ea3774cc 100644 --- a/src/Track.cpp +++ b/src/Track.cpp @@ -770,7 +770,7 @@ Track *SyncLockedTracksIterator::Last(bool skiplinked) // // The TrackList sends events whenever certain updates occur to the list it // is managing. Any other classes that may be interested in get these updates -// should use TrackList::Connect() and TrackList::Disconnect(). +// should use TrackList::Connect() or TrackList::Bind(). // DEFINE_EVENT_TYPE(EVT_TRACKLIST_PERMUTED); DEFINE_EVENT_TYPE(EVT_TRACKLIST_RESIZING); diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index f93a6f79c..87db5f1c0 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -360,20 +360,6 @@ TrackPanel::~TrackPanel() { mTimer.Stop(); - // Unregister for tracklist updates - mTracks->Disconnect(EVT_TRACKLIST_DELETION, - wxCommandEventHandler(TrackPanel::OnTrackListDeletion), - NULL, - this); - mTracks->Disconnect(EVT_TRACKLIST_RESIZING, - wxCommandEventHandler(TrackPanel::OnTrackListResizing), - NULL, - this); - wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK, - wxCommandEventHandler(TrackPanel::OnPlayback), - NULL, - this); - // This can happen if a label is being edited and the user presses // ALT+F4 or Command+Q if (HasCapture()) diff --git a/src/TranslatableStringArray.h b/src/TranslatableStringArray.h index a0c787608..b665302be 100644 --- a/src/TranslatableStringArray.h +++ b/src/TranslatableStringArray.h @@ -43,15 +43,6 @@ public: this); } - ~TranslatableArray() - { - if (wxTheApp) - wxTheApp->Disconnect(EVT_LANGUAGE_CHANGE, - wxCommandEventHandler(TranslatableArray::Invalidate), - NULL, - this); - } - const ArrayType& Get() { if (mContents.empty()) diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 49051e2ce..bc1b2f316 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -307,14 +307,6 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, Center(); } -ContrastDialog::~ContrastDialog() -{ - mForegroundRMSText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar)); - mBackgroundRMSText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar)); - mPassFailText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar)); - mDiffText->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(ContrastDialog::OnChar)); -} - void ContrastDialog::OnGetURL(wxCommandEvent & WXUNUSED(event)) { // Original help page is back on-line (March 2016), but the manual should be more reliable. diff --git a/src/effects/Contrast.h b/src/effects/Contrast.h index c3d28db3c..23dacdc92 100644 --- a/src/effects/Contrast.h +++ b/src/effects/Contrast.h @@ -32,7 +32,6 @@ public: // constructors and destructors ContrastDialog(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & pos); - ~ContrastDialog(); wxButton * m_pButton_UseCurrentF; wxButton * m_pButton_UseCurrentB; diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index f76e246b2..e8f16a1d1 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -3845,16 +3845,6 @@ void EffectUIHost::CleanupRealtime() { if (mSupportsRealtime && mInitialized) { - wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK, - wxCommandEventHandler(EffectUIHost::OnPlayback), - NULL, - this); - - wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, - wxCommandEventHandler(EffectUIHost::OnCapture), - NULL, - this); - EffectManager::Get().RealtimeRemoveEffect(mEffect); mInitialized = false; diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 33ef631be..7e5d6fc14 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -89,37 +89,6 @@ KeyConfigPrefs::KeyConfigPrefs(wxWindow * parent, wxWindowID winid, } } -KeyConfigPrefs::~KeyConfigPrefs() -{ - if (mKey) - { - mKey->Disconnect(wxEVT_KEY_DOWN, - wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown), - NULL, - this); - mKey->Disconnect(wxEVT_CHAR, - wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar), - NULL, - this); - mKey->Disconnect(wxEVT_KILL_FOCUS, - wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus), - NULL, - this); - } - - if (mFilter) - { - mKey->Disconnect(wxEVT_KEY_DOWN, - wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown), - NULL, - this); - mKey->Disconnect(wxEVT_CHAR, - wxKeyEventHandler(KeyConfigPrefs::OnFilterChar), - NULL, - this); - } -} - void KeyConfigPrefs::Populate() { ShuttleGui S(this, eIsCreatingFromPrefs); diff --git a/src/prefs/KeyConfigPrefs.h b/src/prefs/KeyConfigPrefs.h index 19f66233e..8f924d83a 100644 --- a/src/prefs/KeyConfigPrefs.h +++ b/src/prefs/KeyConfigPrefs.h @@ -36,7 +36,6 @@ class KeyConfigPrefs final : public PrefsPanel { public: KeyConfigPrefs(wxWindow * parent, wxWindowID winid, const wxString &name); - ~KeyConfigPrefs(); bool Commit() override; void Cancel() override; wxString HelpPageName() override; diff --git a/src/toolbars/ToolManager.cpp b/src/toolbars/ToolManager.cpp index f280b6ca3..c773b8172 100644 --- a/src/toolbars/ToolManager.cpp +++ b/src/toolbars/ToolManager.cpp @@ -458,30 +458,6 @@ ToolManager::~ToolManager() // crashing when running with Jaws on Windows 10 1703. mTopDock->GetConfiguration().Clear(); mBotDock->GetConfiguration().Clear(); - - // Remove handlers from parent - mParent->Disconnect( wxEVT_LEFT_UP, - wxMouseEventHandler( ToolManager::OnMouse ), - NULL, - this ); - mParent->Disconnect( wxEVT_MOTION, - wxMouseEventHandler( ToolManager::OnMouse ), - NULL, - this ); - mParent->Disconnect( wxEVT_MOUSE_CAPTURE_LOST, - wxMouseCaptureLostEventHandler( ToolManager::OnCaptureLost ), - NULL, - this ); - - // Remove our event handlers - mIndicator->Disconnect( wxEVT_CREATE, - wxWindowCreateEventHandler( ToolManager::OnIndicatorCreate ), - NULL, - this ); - mIndicator->Disconnect( wxEVT_PAINT, - wxPaintEventHandler( ToolManager::OnIndicatorPaint ), - NULL, - this ); } // This table describes the default configuration of the toolbars as diff --git a/src/tracks/ui/PlayIndicatorOverlay.cpp b/src/tracks/ui/PlayIndicatorOverlay.cpp index 370f2ab23..25cffca14 100644 --- a/src/tracks/ui/PlayIndicatorOverlay.cpp +++ b/src/tracks/ui/PlayIndicatorOverlay.cpp @@ -117,11 +117,6 @@ PlayIndicatorOverlay::~PlayIndicatorOverlay() if(ruler) ruler->RemoveOverlay(mPartner.get()); } - - mProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(PlayIndicatorOverlay::OnTimer), - NULL, - this); } void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event) diff --git a/src/tracks/ui/Scrubbing.cpp b/src/tracks/ui/Scrubbing.cpp index 65165f293..a4e4c52e0 100644 --- a/src/tracks/ui/Scrubbing.cpp +++ b/src/tracks/ui/Scrubbing.cpp @@ -212,10 +212,6 @@ Scrubber::~Scrubber() #endif mProject->PopEventHandler(); - if (wxTheApp) - wxTheApp->Disconnect - (wxEVT_ACTIVATE_APP, - wxActivateEventHandler(Scrubber::OnActivateOrDeactivateApp), NULL, this); } namespace { @@ -736,14 +732,6 @@ ScrubbingOverlay::ScrubbingOverlay(AudacityProject *project) this); } -ScrubbingOverlay::~ScrubbingOverlay() -{ - mProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(ScrubbingOverlay::OnTimer), - NULL, - this); -} - std::pair ScrubbingOverlay::DoGetRectangle(wxSize) { wxRect rect(mLastScrubRect); diff --git a/src/tracks/ui/Scrubbing.h b/src/tracks/ui/Scrubbing.h index f67f0a501..611240ca2 100644 --- a/src/tracks/ui/Scrubbing.h +++ b/src/tracks/ui/Scrubbing.h @@ -209,7 +209,6 @@ class ScrubbingOverlay final : public wxEvtHandler, public Overlay { public: ScrubbingOverlay(AudacityProject *project); - virtual ~ScrubbingOverlay(); private: std::pair DoGetRectangle(wxSize size) override; diff --git a/src/tracks/ui/SelectHandle.cpp b/src/tracks/ui/SelectHandle.cpp index 6c3b8c456..e40ead22a 100644 --- a/src/tracks/ui/SelectHandle.cpp +++ b/src/tracks/ui/SelectHandle.cpp @@ -1048,15 +1048,6 @@ public: this); } - ~TimerHandler() - { - if (mConnectedProject) - mConnectedProject->Disconnect(EVT_TRACK_PANEL_TIMER, - wxCommandEventHandler(SelectHandle::TimerHandler::OnTimer), - NULL, - this); - } - // Receives timer event notifications, to implement auto-scroll void OnTimer(wxCommandEvent &event); diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 89747653e..f36905ddb 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -340,35 +340,6 @@ void MeterPanel::Clear() mQueue.Clear(); } -MeterPanel::~MeterPanel() -{ - if (mIsInput) - { - // Unregister for AudioIO events - wxTheApp->Disconnect(EVT_AUDIOIO_MONITOR, - wxCommandEventHandler(MeterPanel::OnAudioIOStatus), - NULL, - this); - wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, - wxCommandEventHandler(MeterPanel::OnAudioIOStatus), - NULL, - this); - } - else - { - wxTheApp->Disconnect(EVT_AUDIOIO_PLAYBACK, - wxCommandEventHandler(MeterPanel::OnAudioIOStatus), - NULL, - this); - } - - // Unregister for our preference update event - wxTheApp->Disconnect(EVT_METER_PREFERENCES_CHANGED, - wxCommandEventHandler(MeterPanel::OnMeterPrefsUpdated), - NULL, - this); -} - void MeterPanel::UpdatePrefs() { mDBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE); diff --git a/src/widgets/Meter.h b/src/widgets/Meter.h index 593fae905..037f1ca0e 100644 --- a/src/widgets/Meter.h +++ b/src/widgets/Meter.h @@ -114,8 +114,6 @@ class MeterPanel final : public wxPanelWrapper Style style = HorizontalStereo, float fDecayRate = 60.0f); - ~MeterPanel(); - bool AcceptsFocus() const override { return s_AcceptsFocus; } bool AcceptsFocusFromKeyboard() const override { return true; } diff --git a/src/widgets/PopupMenuTable.cpp b/src/widgets/PopupMenuTable.cpp index 6aefbcd59..0208da508 100644 --- a/src/widgets/PopupMenuTable.cpp +++ b/src/widgets/PopupMenuTable.cpp @@ -13,6 +13,8 @@ Paul Licameli split from TrackPanel.cpp PopupMenuTable::Menu::~Menu() { + // Event connections between the parent window and the singleton table + // object must be broken when this menu is destroyed. Disconnect(); } diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index c07ef628d..e968b39ca 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -2031,11 +2031,6 @@ AdornedRulerPanel::~AdornedRulerPanel() { if(HasCapture()) ReleaseMouse(); - - wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE, - wxCommandEventHandler(AdornedRulerPanel::OnCapture), - NULL, - this); } #if 1 diff --git a/src/widgets/wxPanelWrapper.h b/src/widgets/wxPanelWrapper.h index 1e0934a99..03b509cd6 100644 --- a/src/widgets/wxPanelWrapper.h +++ b/src/widgets/wxPanelWrapper.h @@ -27,11 +27,6 @@ public: { this->Bind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook); } - - ~wxTabTraversalWrapper() - { - this->Unbind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook); - } }; class AUDACITY_DLL_API wxPanelWrapper : public wxTabTraversalWrapper