1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-11 16:50:25 +02:00

Stack-allocate where possible! ...

... Removed many unnecessary naked news and deletes.
This commit is contained in:
Paul Licameli
2016-01-31 20:39:24 -05:00
parent be1d9b7dd5
commit dbaa811577
43 changed files with 785 additions and 839 deletions

View File

@@ -1001,14 +1001,14 @@ void FreqWindow::Recalc()
// just the mProgress window with the idea of preventing user interaction with the
// controls while the plot was being recalculated. This doesn't appear to be necessary
// so just use the the top level window instead.
wxWindowDisabler *blocker = new wxWindowDisabler(this);
wxYieldIfNeeded();
{
wxWindowDisabler blocker(this);
wxYieldIfNeeded();
mAnalyst->Calculate(alg, windowFunc, mWindowSize, mRate,
mData, mDataLen,
&mYMin, &mYMax, mProgress);
delete blocker;
mAnalyst->Calculate(alg, windowFunc, mWindowSize, mRate,
mData, mDataLen,
&mYMin, &mYMax, mProgress);
}
if (hadFocus) {
hadFocus->SetFocus();
}
@@ -1033,16 +1033,14 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event))
wxString fName = _("spectrum.txt");
fName = FileSelector(_("Export Spectral Data As:"),
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
if (fName == wxT(""))
return;
wxTextFile f(fName);
#ifdef __WXMAC__
wxFile *temp = new wxFile();
temp->Create(fName);
delete temp;
wxFile{}.Create(fName);
#else
f.Create();
#endif