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

TrackFactory functions return std::unique_ptr, although some callers...

... release() them for now.
This commit is contained in:
Paul Licameli
2016-03-02 14:59:31 -05:00
parent f42a953752
commit 5ef4dd46a5
31 changed files with 91 additions and 135 deletions

View File

@@ -319,7 +319,7 @@ bool LabelDialog::TransferDataFromWindow()
wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
// Create the NEW track and add to track list
LabelTrack *newTrack = mFactory.NewLabelTrack();
LabelTrack *newTrack = mFactory.NewLabelTrack().release();
newTrack->SetName(name);
mTracks->Add(newTrack);
tndx++;
@@ -564,14 +564,13 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event))
else {
// Create a temporary label track and load the labels
// into it
LabelTrack *lt = mFactory.NewLabelTrack();
auto lt = mFactory.NewLabelTrack();
lt->Import(f);
// Add the labesls to our collection
AddLabels(lt);
AddLabels(lt.get());
// Done with the temporary track
delete lt;
}
// Repopulate the grid
@@ -632,7 +631,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
}
// Transfer our collection to a temporary label track
LabelTrack *lt = mFactory.NewLabelTrack();
auto lt = mFactory.NewLabelTrack();
int i;
for (i = 0; i < cnt; i++) {
@@ -643,7 +642,6 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
// Export them and clean
lt->Export(f);
delete lt;
#ifdef __WXMAC__
f.Write(wxTextFileType_Mac);