1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-20 06:10:06 +02:00

AudacityProject::mIsBeingDeleted was redundant

This commit is contained in:
Paul Licameli 2019-05-02 07:00:25 -04:00
parent 9f377b3b75
commit 5ed9fa972b
2 changed files with 6 additions and 9 deletions

View File

@ -2494,7 +2494,7 @@ void AudacityProject::OnActivate(wxActivateEvent & event)
{
// Activate events can fire during window teardown, so just
// ignore them.
if (mIsDeleting) {
if (IsBeingDeleted()) {
return;
}
@ -2580,12 +2580,13 @@ public:
// and/or attempts to DELETE objects twice.
void AudacityProject::OnCloseWindow(wxCloseEvent & event)
{
auto &window = *this;
// We are called for the wxEVT_CLOSE_WINDOW, wxEVT_END_SESSION, and
// wxEVT_QUERY_END_SESSION, so we have to protect against multiple
// entries. This is a hack until the whole application termination
// process can be reviewed and reworked. (See bug #964 for ways
// to exercise the bug that instigated this hack.)
if (mIsBeingDeleted)
if (window.IsBeingDeleted())
{
event.Skip();
return;
@ -2683,7 +2684,7 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
// its size change.
AllProjects::SaveWindowSize();
mIsDeleting = true;
window.SetIsBeingDeleted();
// Mac: we never quit as the result of a close.
// Other systems: we quit only when the close is the result of an external
@ -2817,9 +2818,6 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
// Destroys this
pSelf.reset();
mRuler = nullptr;
mIsBeingDeleted = true;
}
void AudacityProject::OnOpenAudioFile(wxCommandEvent & event)

View File

@ -675,6 +675,8 @@ private:
public:
bool EmptyCanBeDirty() const { return mEmptyCanBeDirty; }
bool IsBeingDeleted() const { return mIsDeleting; }
void SetIsBeingDeleted() { mIsDeleting = true; }
private:
bool mIsSyncLocked;
@ -717,9 +719,6 @@ public:
private:
bool mbInitializingScrollbar{ false };
// See explanation in OnCloseWindow
bool mIsBeingDeleted{ false };
// TrackPanelOverlay objects
std::shared_ptr<Overlay>
mIndicatorOverlay, mCursorOverlay;