1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-15 07:01:18 +02:00

Use macro safenew for many allocations of wxWindow subclasses

This commit is contained in:
Paul Licameli
2016-02-13 18:06:49 -05:00
parent 6052b5f9be
commit 3f237daddc
42 changed files with 238 additions and 214 deletions

View File

@@ -243,7 +243,7 @@ static wxString AskCopyOrEdit()
wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
dialog.SetSizer(vbox);
wxStaticText *message = new wxStaticText(&dialog, -1, wxString::Format(_("\
wxStaticText *message = safenew wxStaticText(&dialog, -1, wxString::Format(_("\
When importing uncompressed audio files you can either copy them \
into the project, or read them directly from their current location (without copying).\n\n\
Your current preference is set to %s.\n\n\
@@ -259,19 +259,19 @@ How do you want to import the current file(s)?"), oldCopyPref == wxT("copy") ? _
vbox->Add(message, 1, wxALL | wxEXPAND, 10);
wxStaticBox *box = new wxStaticBox(&dialog, -1, _("Choose an import method"));
wxStaticBox *box = safenew wxStaticBox(&dialog, -1, _("Choose an import method"));
box->SetName(box->GetLabel());
wxStaticBoxSizer *boxsizer = new wxStaticBoxSizer(box, wxVERTICAL);
wxRadioButton *copyRadio = new wxRadioButton(&dialog, -1, _("Make a &copy of the files before editing (safer)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
wxRadioButton *copyRadio = safenew wxRadioButton(&dialog, -1, _("Make a &copy of the files before editing (safer)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
boxsizer->Add(copyRadio, 0, wxALL);
copyRadio->SetName(wxStripMenuCodes(copyRadio->GetLabel()));
wxRadioButton *aliasRadio = new wxRadioButton(&dialog, -1, _("Read the files &directly from the original (faster)"));
wxRadioButton *aliasRadio = safenew wxRadioButton(&dialog, -1, _("Read the files &directly from the original (faster)"));
boxsizer->Add(aliasRadio, 0, wxALL);
aliasRadio->SetName(wxStripMenuCodes(aliasRadio->GetLabel()));
wxCheckBox *dontAskNextTimeBox = new wxCheckBox(&dialog, -1, _("Don't &warn again and always use my choice above"));
wxCheckBox *dontAskNextTimeBox = safenew wxCheckBox(&dialog, -1, _("Don't &warn again and always use my choice above"));
boxsizer->Add(dontAskNextTimeBox, 0, wxALL);
vbox->Add(boxsizer, 0, wxALL, 10);
dontAskNextTimeBox->SetName(wxStripMenuCodes(dontAskNextTimeBox->GetLabel()));