1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-16 07:47:58 +01:00

Accessor for shared pointer to track, given only a bare pointer

This commit is contained in:
Paul Licameli
2017-06-22 20:29:32 -04:00
parent 1fce8b54f2
commit bd5d2bf114
2 changed files with 24 additions and 0 deletions

View File

@@ -942,6 +942,8 @@ auto TrackList::Replace(Track * t, value_type &&with) -> value_type
value_type holder;
if (t && with) {
auto node = t->GetNode();
t->SetOwner(nullptr, {});
holder = std::move(*node);
Track *pTrack = with.get();
@@ -962,6 +964,7 @@ TrackNodePointer TrackList::Remove(Track *t)
TrackNodePointer result(end());
if (t) {
auto node = t->GetNode();
t->SetOwner(nullptr, {});
if (!isNull(node)) {
value_type holder = std::move( *node );