1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-29 08:43:56 +01:00

Manage TrackControls and TrackVRulerControls by shared_ptr; ...

... they are not singletons; and the back-pointers to their Tracks are weak.
This commit is contained in:
Paul Licameli
2017-06-23 17:33:45 -04:00
parent c355b82dc6
commit 35ce499ce1
33 changed files with 117 additions and 172 deletions

View File

@@ -2348,7 +2348,7 @@ void TrackPanel::OnTrackMenu(Track *t)
return;
}
TrackPanelCell *const pCell = t->GetTrackControl();
const auto pCell = t->GetTrackControl();
const wxRect rect(FindTrackRect(t, true));
const UIHandle::Result refreshResult =
pCell->DoContextMenu(rect, this, NULL);
@@ -3112,10 +3112,10 @@ TrackPanelCellIterator &TrackPanelCellIterator::operator++ ()
mpCell = mpTrack;
break;
case CellType::Label:
mpCell = mpTrack->GetTrackControl();
mpCell = mpTrack->GetTrackControl().get();
break;
case CellType::VRuler:
mpCell = mpTrack->GetVRulerControl();
mpCell = mpTrack->GetVRulerControl().get();
break;
case CellType::Resizer: {
auto instance = &TrackPanelResizerCell::Instance();