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

TrackList constructed only by factory function, to avoid more trouble

This commit is contained in:
Paul Licameli
2017-07-14 21:47:47 -04:00
parent 84a6bad8a0
commit 8bf3791edf
10 changed files with 42 additions and 42 deletions

View File

@@ -762,10 +762,12 @@ TrackList::TrackList()
{
}
TrackList::TrackList(const TrackList &that)
: ListOfTracks{}
// Factory function
std::shared_ptr<TrackList> TrackList::Create()
{
DoAssign(that);
std::shared_ptr<TrackList> result{ safenew TrackList{} };
result->mSelf = result;
return result;
}
TrackList& TrackList::operator= (const TrackList &that)
@@ -777,11 +779,6 @@ TrackList& TrackList::operator= (const TrackList &that)
return *this;
}
TrackList::TrackList(TrackList &&that)
{
Swap(that);
}
TrackList &TrackList::operator= (TrackList &&that)
{
if (this != &that) {