1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Bug 1677 - Swap two tracks leads to crash on exit.

This commit is contained in:
James Crook
2017-07-04 11:53:07 +01:00
parent b46abbec62
commit 9ab40113b7

View File

@@ -183,6 +183,8 @@ HitTestPreview TrackSelectHandle::Preview
UIHandle::Result TrackSelectHandle::Release UIHandle::Result TrackSelectHandle::Release
(const TrackPanelMouseEvent &, AudacityProject *, wxWindow *) (const TrackPanelMouseEvent &, AudacityProject *, wxWindow *)
{ {
// If we're releasing, surely we are dragging a track?
wxASSERT( mpTrack );
if (mRearrangeCount != 0) { if (mRearrangeCount != 0) {
AudacityProject *const project = ::GetActiveProject(); AudacityProject *const project = ::GetActiveProject();
wxString dir; wxString dir;
@@ -194,6 +196,11 @@ UIHandle::Result TrackSelectHandle::Release
dir.c_str()), dir.c_str()),
_("Move Track")); _("Move Track"));
} }
// Bug 1677
// Holding on to the reference to the track was causing it to be released far later
// than necessary, on shutdown, and so causing a crash as a dialog about cleaning
// out files could not show at that time.
mpTrack.reset();
// No need to redraw, that was done when drag moved the track // No need to redraw, that was done when drag moved the track
return RefreshCode::RefreshNone; return RefreshCode::RefreshNone;
} }