1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-05 22:21:15 +01:00

Review uses of safenew...

... add comments and assertions, and use make_unique instead where possible
This commit is contained in:
Paul Licameli
2016-08-13 23:16:05 -04:00
parent 84a6456788
commit 32f24eabb2
13 changed files with 24 additions and 6 deletions

View File

@@ -184,6 +184,7 @@ void ShowModelessErrorDialog(wxWindow *parent,
const wxString &helpURL,
const bool Close)
{
wxASSERT(parent);
ErrorDialog *dlog = safenew ErrorDialog(parent, dlogTitle, message, helpURL, Close, false);
dlog->CentreOnParent();
dlog->Show();
@@ -199,6 +200,7 @@ void ShowAliasMissingDialog(AudacityProject *parent,
const wxString &helpURL,
const bool Close)
{
wxASSERT(parent); // to justify safenew
ErrorDialog *dlog = safenew AliasedFileMissingDialog(parent, dlogTitle, message, helpURL, Close, false);
// Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
// instead put it just above or on the top of the project.