mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
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.
This commit is contained in:
parent
12983e1685
commit
bf5228267a
@ -57,11 +57,6 @@ AudacityLogger::AudacityLogger()
|
|||||||
mUpdated = false;
|
mUpdated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudacityLogger::~AudacityLogger()
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudacityLogger::Flush()
|
void AudacityLogger::Flush()
|
||||||
{
|
{
|
||||||
if (mUpdated && mFrame && mFrame->IsShown()) {
|
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)
|
void AudacityLogger::Show(bool show)
|
||||||
{
|
{
|
||||||
// Hide the frame if created, otherwise do nothing
|
// 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
|
// On the Mac, destroy the window rather than hiding it since the
|
||||||
// log menu will override the root windows menu if there is no
|
// log menu will override the root windows menu if there is no
|
||||||
// project window open.
|
// project window open.
|
||||||
Destroy();
|
mFrame.reset();
|
||||||
#else
|
#else
|
||||||
Show(false);
|
Show(false);
|
||||||
#endif
|
#endif
|
||||||
|
@ -28,10 +28,8 @@
|
|||||||
class AudacityLogger final : public wxEvtHandler, public wxLog {
|
class AudacityLogger final : public wxEvtHandler, public wxLog {
|
||||||
public:
|
public:
|
||||||
AudacityLogger();
|
AudacityLogger();
|
||||||
virtual ~AudacityLogger();
|
|
||||||
|
|
||||||
void Show(bool show = true);
|
void Show(bool show = true);
|
||||||
void Destroy();
|
|
||||||
|
|
||||||
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
||||||
wxString GetLog();
|
wxString GetLog();
|
||||||
|
@ -152,21 +152,6 @@ HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager):
|
|||||||
this);
|
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)
|
void HistoryWindow::OnAudioIO(wxCommandEvent& evt)
|
||||||
{
|
{
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
|
@ -28,7 +28,6 @@ class HistoryWindow final : public wxDialogWrapper {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
HistoryWindow(AudacityProject * parent, UndoManager *manager);
|
HistoryWindow(AudacityProject * parent, UndoManager *manager);
|
||||||
~HistoryWindow();
|
|
||||||
|
|
||||||
void UpdateDisplay();
|
void UpdateDisplay();
|
||||||
|
|
||||||
|
@ -133,14 +133,6 @@ LyricsWindow::LyricsWindow(AudacityProject *parent):
|
|||||||
Center();
|
Center();
|
||||||
}
|
}
|
||||||
|
|
||||||
LyricsWindow::~LyricsWindow()
|
|
||||||
{
|
|
||||||
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(LyricsWindow::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void LyricsWindow::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
|
void LyricsWindow::OnCloseWindow(wxCloseEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
this->Hide();
|
this->Hide();
|
||||||
|
@ -23,7 +23,6 @@ class LyricsWindow final : public wxFrame {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
LyricsWindow(AudacityProject* parent);
|
LyricsWindow(AudacityProject* parent);
|
||||||
virtual ~LyricsWindow();
|
|
||||||
|
|
||||||
LyricsPanel *GetLyricsPanel() { return mLyricsPanel; };
|
LyricsPanel *GetLyricsPanel() { return mLyricsPanel; };
|
||||||
|
|
||||||
|
@ -934,17 +934,6 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MixerBoard::~MixerBoard()
|
|
||||||
{
|
|
||||||
// private data members
|
|
||||||
mMusicalInstruments.clear();
|
|
||||||
|
|
||||||
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(MixerBoard::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,7 +206,6 @@ public:
|
|||||||
wxFrame* parent,
|
wxFrame* parent,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize);
|
const wxSize& size = wxDefaultSize);
|
||||||
virtual ~MixerBoard();
|
|
||||||
|
|
||||||
void UpdatePrefs();
|
void UpdatePrefs();
|
||||||
|
|
||||||
|
@ -423,7 +423,6 @@ class PluginRegistrationDialog final : public wxDialogWrapper
|
|||||||
public:
|
public:
|
||||||
// constructors and destructors
|
// constructors and destructors
|
||||||
PluginRegistrationDialog(wxWindow *parent, EffectType type);
|
PluginRegistrationDialog(wxWindow *parent, EffectType type);
|
||||||
virtual ~PluginRegistrationDialog();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Populate();
|
void Populate();
|
||||||
@ -501,14 +500,6 @@ PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType
|
|||||||
Populate();
|
Populate();
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginRegistrationDialog::~PluginRegistrationDialog()
|
|
||||||
{
|
|
||||||
mEffects->Disconnect(wxEVT_KEY_DOWN,
|
|
||||||
wxKeyEventHandler(PluginRegistrationDialog::OnListChar),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PluginRegistrationDialog::Populate()
|
void PluginRegistrationDialog::Populate()
|
||||||
{
|
{
|
||||||
//------------------------- Main section --------------------
|
//------------------------- Main section --------------------
|
||||||
|
@ -1258,11 +1258,6 @@ AudacityProject::~AudacityProject()
|
|||||||
mTrackPanel->RemoveOverlay(mCursorOverlay.get());
|
mTrackPanel->RemoveOverlay(mCursorOverlay.get());
|
||||||
mTrackPanel->RemoveOverlay(mIndicatorOverlay.get());
|
mTrackPanel->RemoveOverlay(mIndicatorOverlay.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE,
|
|
||||||
wxCommandEventHandler(AudacityProject::OnCapture),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::ApplyUpdatedTheme()
|
void AudacityProject::ApplyUpdatedTheme()
|
||||||
@ -2715,11 +2710,6 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
this->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(ViewInfo::OnTimer),
|
|
||||||
NULL,
|
|
||||||
&mViewInfo);
|
|
||||||
|
|
||||||
// Destroys this
|
// Destroys this
|
||||||
pSelf.reset();
|
pSelf.reset();
|
||||||
mRuler = nullptr;
|
mRuler = nullptr;
|
||||||
@ -6038,14 +6028,6 @@ AudacityProject::PlaybackScroller::PlaybackScroller(AudacityProject *project)
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
AudacityProject::PlaybackScroller::~PlaybackScroller()
|
|
||||||
{
|
|
||||||
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(PlaybackScroller::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudacityProject::PlaybackScroller::OnTimer(wxCommandEvent &event)
|
void AudacityProject::PlaybackScroller::OnTimer(wxCommandEvent &event)
|
||||||
{
|
{
|
||||||
// Let other listeners get the notification
|
// Let other listeners get the notification
|
||||||
|
@ -793,7 +793,6 @@ public:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit PlaybackScroller(AudacityProject *project);
|
explicit PlaybackScroller(AudacityProject *project);
|
||||||
~PlaybackScroller();
|
|
||||||
|
|
||||||
enum class Mode {
|
enum class Mode {
|
||||||
Off,
|
Off,
|
||||||
|
@ -770,7 +770,7 @@ Track *SyncLockedTracksIterator::Last(bool skiplinked)
|
|||||||
//
|
//
|
||||||
// The TrackList sends events whenever certain updates occur to the list it
|
// 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
|
// 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_PERMUTED);
|
||||||
DEFINE_EVENT_TYPE(EVT_TRACKLIST_RESIZING);
|
DEFINE_EVENT_TYPE(EVT_TRACKLIST_RESIZING);
|
||||||
|
@ -360,20 +360,6 @@ TrackPanel::~TrackPanel()
|
|||||||
{
|
{
|
||||||
mTimer.Stop();
|
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
|
// This can happen if a label is being edited and the user presses
|
||||||
// ALT+F4 or Command+Q
|
// ALT+F4 or Command+Q
|
||||||
if (HasCapture())
|
if (HasCapture())
|
||||||
|
@ -43,15 +43,6 @@ public:
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~TranslatableArray()
|
|
||||||
{
|
|
||||||
if (wxTheApp)
|
|
||||||
wxTheApp->Disconnect(EVT_LANGUAGE_CHANGE,
|
|
||||||
wxCommandEventHandler(TranslatableArray::Invalidate),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
const ArrayType& Get()
|
const ArrayType& Get()
|
||||||
{
|
{
|
||||||
if (mContents.empty())
|
if (mContents.empty())
|
||||||
|
@ -307,14 +307,6 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
|
|||||||
Center();
|
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))
|
void ContrastDialog::OnGetURL(wxCommandEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
// Original help page is back on-line (March 2016), but the manual should be more reliable.
|
// Original help page is back on-line (March 2016), but the manual should be more reliable.
|
||||||
|
@ -32,7 +32,6 @@ public:
|
|||||||
// constructors and destructors
|
// constructors and destructors
|
||||||
ContrastDialog(wxWindow * parent, wxWindowID id,
|
ContrastDialog(wxWindow * parent, wxWindowID id,
|
||||||
const wxString & title, const wxPoint & pos);
|
const wxString & title, const wxPoint & pos);
|
||||||
~ContrastDialog();
|
|
||||||
|
|
||||||
wxButton * m_pButton_UseCurrentF;
|
wxButton * m_pButton_UseCurrentF;
|
||||||
wxButton * m_pButton_UseCurrentB;
|
wxButton * m_pButton_UseCurrentB;
|
||||||
|
@ -3845,16 +3845,6 @@ void EffectUIHost::CleanupRealtime()
|
|||||||
{
|
{
|
||||||
if (mSupportsRealtime && mInitialized)
|
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);
|
EffectManager::Get().RealtimeRemoveEffect(mEffect);
|
||||||
|
|
||||||
mInitialized = false;
|
mInitialized = false;
|
||||||
|
@ -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()
|
void KeyConfigPrefs::Populate()
|
||||||
{
|
{
|
||||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||||
|
@ -36,7 +36,6 @@ class KeyConfigPrefs final : public PrefsPanel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KeyConfigPrefs(wxWindow * parent, wxWindowID winid, const wxString &name);
|
KeyConfigPrefs(wxWindow * parent, wxWindowID winid, const wxString &name);
|
||||||
~KeyConfigPrefs();
|
|
||||||
bool Commit() override;
|
bool Commit() override;
|
||||||
void Cancel() override;
|
void Cancel() override;
|
||||||
wxString HelpPageName() override;
|
wxString HelpPageName() override;
|
||||||
|
@ -458,30 +458,6 @@ ToolManager::~ToolManager()
|
|||||||
// crashing when running with Jaws on Windows 10 1703.
|
// crashing when running with Jaws on Windows 10 1703.
|
||||||
mTopDock->GetConfiguration().Clear();
|
mTopDock->GetConfiguration().Clear();
|
||||||
mBotDock->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
|
// This table describes the default configuration of the toolbars as
|
||||||
|
@ -117,11 +117,6 @@ PlayIndicatorOverlay::~PlayIndicatorOverlay()
|
|||||||
if(ruler)
|
if(ruler)
|
||||||
ruler->RemoveOverlay(mPartner.get());
|
ruler->RemoveOverlay(mPartner.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(PlayIndicatorOverlay::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
||||||
|
@ -212,10 +212,6 @@ Scrubber::~Scrubber()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
mProject->PopEventHandler();
|
mProject->PopEventHandler();
|
||||||
if (wxTheApp)
|
|
||||||
wxTheApp->Disconnect
|
|
||||||
(wxEVT_ACTIVATE_APP,
|
|
||||||
wxActivateEventHandler(Scrubber::OnActivateOrDeactivateApp), NULL, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -736,14 +732,6 @@ ScrubbingOverlay::ScrubbingOverlay(AudacityProject *project)
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrubbingOverlay::~ScrubbingOverlay()
|
|
||||||
{
|
|
||||||
mProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(ScrubbingOverlay::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::pair<wxRect, bool> ScrubbingOverlay::DoGetRectangle(wxSize)
|
std::pair<wxRect, bool> ScrubbingOverlay::DoGetRectangle(wxSize)
|
||||||
{
|
{
|
||||||
wxRect rect(mLastScrubRect);
|
wxRect rect(mLastScrubRect);
|
||||||
|
@ -209,7 +209,6 @@ class ScrubbingOverlay final : public wxEvtHandler, public Overlay
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScrubbingOverlay(AudacityProject *project);
|
ScrubbingOverlay(AudacityProject *project);
|
||||||
virtual ~ScrubbingOverlay();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::pair<wxRect, bool> DoGetRectangle(wxSize size) override;
|
std::pair<wxRect, bool> DoGetRectangle(wxSize size) override;
|
||||||
|
@ -1048,15 +1048,6 @@ public:
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~TimerHandler()
|
|
||||||
{
|
|
||||||
if (mConnectedProject)
|
|
||||||
mConnectedProject->Disconnect(EVT_TRACK_PANEL_TIMER,
|
|
||||||
wxCommandEventHandler(SelectHandle::TimerHandler::OnTimer),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Receives timer event notifications, to implement auto-scroll
|
// Receives timer event notifications, to implement auto-scroll
|
||||||
void OnTimer(wxCommandEvent &event);
|
void OnTimer(wxCommandEvent &event);
|
||||||
|
|
||||||
|
@ -340,35 +340,6 @@ void MeterPanel::Clear()
|
|||||||
mQueue.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()
|
void MeterPanel::UpdatePrefs()
|
||||||
{
|
{
|
||||||
mDBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
|
mDBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
|
||||||
|
@ -114,8 +114,6 @@ class MeterPanel final : public wxPanelWrapper
|
|||||||
Style style = HorizontalStereo,
|
Style style = HorizontalStereo,
|
||||||
float fDecayRate = 60.0f);
|
float fDecayRate = 60.0f);
|
||||||
|
|
||||||
~MeterPanel();
|
|
||||||
|
|
||||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||||
bool AcceptsFocusFromKeyboard() const override { return true; }
|
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@ Paul Licameli split from TrackPanel.cpp
|
|||||||
|
|
||||||
PopupMenuTable::Menu::~Menu()
|
PopupMenuTable::Menu::~Menu()
|
||||||
{
|
{
|
||||||
|
// Event connections between the parent window and the singleton table
|
||||||
|
// object must be broken when this menu is destroyed.
|
||||||
Disconnect();
|
Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2031,11 +2031,6 @@ AdornedRulerPanel::~AdornedRulerPanel()
|
|||||||
{
|
{
|
||||||
if(HasCapture())
|
if(HasCapture())
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
|
|
||||||
wxTheApp->Disconnect(EVT_AUDIOIO_CAPTURE,
|
|
||||||
wxCommandEventHandler(AdornedRulerPanel::OnCapture),
|
|
||||||
NULL,
|
|
||||||
this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -27,11 +27,6 @@ public:
|
|||||||
{
|
{
|
||||||
this->Bind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook);
|
this->Bind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook);
|
||||||
}
|
}
|
||||||
|
|
||||||
~wxTabTraversalWrapper()
|
|
||||||
{
|
|
||||||
this->Unbind(wxEVT_CHAR_HOOK, wxTabTraversalWrapperCharHook);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AUDACITY_DLL_API wxPanelWrapper : public wxTabTraversalWrapper<wxPanel>
|
class AUDACITY_DLL_API wxPanelWrapper : public wxTabTraversalWrapper<wxPanel>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user