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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user