1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-21 16:11:11 +01:00

More uses of safenew for classes we derive from wxWindow classes...

... Also removed some unnecessary deletes of widgets that are managed by parent
windows
This commit is contained in:
Paul Licameli
2016-02-14 02:54:25 -05:00
parent 3f237daddc
commit df6a7c5464
70 changed files with 151 additions and 120 deletions

View File

@@ -84,5 +84,6 @@ BatchPrefs::~BatchPrefs()
PrefsPanel *BatchPrefsFactory::Create(wxWindow *parent)
{
return new BatchPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew BatchPrefs(parent);
}

View File

@@ -374,5 +374,6 @@ bool DevicePrefs::Apply()
PrefsPanel *DevicePrefsFactory::Create(wxWindow *parent)
{
return new DevicePrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew DevicePrefs(parent);
}

View File

@@ -266,5 +266,6 @@ bool DirectoriesPrefs::Apply()
PrefsPanel *DirectoriesPrefsFactory::Create(wxWindow *parent)
{
return new DirectoriesPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew DirectoriesPrefs(parent);
}

View File

@@ -170,5 +170,6 @@ bool EffectsPrefs::Apply()
PrefsPanel *EffectsPrefsFactory::Create(wxWindow *parent)
{
return new EffectsPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew EffectsPrefs(parent);
}

View File

@@ -783,5 +783,6 @@ void ExtImportPrefsDropTarget::SetDataObject(wxDataObject* data)
PrefsPanel *ExtImportPrefsFactory::Create(wxWindow *parent)
{
return new ExtImportPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew ExtImportPrefs(parent);
}

View File

@@ -178,5 +178,6 @@ bool GUIPrefs::Apply()
PrefsPanel *GUIPrefsFactory::Create(wxWindow *parent)
{
return new GUIPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew GUIPrefs(parent);
}

View File

@@ -112,5 +112,6 @@ bool ImportExportPrefs::Apply()
PrefsPanel *ImportExportPrefsFactory::Create(wxWindow *parent)
{
return new ImportExportPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew ImportExportPrefs(parent);
}

View File

@@ -230,7 +230,7 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
S.StartHorizontalLay(wxEXPAND, 1);
{
if (!mView) {
mView = new KeyView(this, CommandsListID);
mView = safenew KeyView(this, CommandsListID);
mView->SetName(_("Bindings"));
}
S.Prop(true);
@@ -1209,5 +1209,6 @@ void KeyConfigPrefs::Cancel()
PrefsPanel *KeyConfigPrefsFactory::Create(wxWindow *parent)
{
return new KeyConfigPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew KeyConfigPrefs(parent);
}

View File

@@ -241,5 +241,6 @@ bool LibraryPrefs::Apply()
PrefsPanel *LibraryPrefsFactory::Create(wxWindow *parent)
{
return new LibraryPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew LibraryPrefs(parent);
}

View File

@@ -286,7 +286,8 @@ bool MidiIOPrefs::Validate()
PrefsPanel *MidiIOPrefsFactory::Create(wxWindow *parent)
{
return new MidiIOPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew MidiIOPrefs(parent);
}
#endif

View File

@@ -163,7 +163,6 @@ void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){
PrefsPanel *ModulePrefsFactory::Create(wxWindow *parent)
{
return new ModulePrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew ModulePrefs(parent);
}

View File

@@ -205,5 +205,6 @@ bool MousePrefs::Apply()
PrefsPanel *MousePrefsFactory::Create(wxWindow *parent)
{
return new MousePrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew MousePrefs(parent);
}

View File

@@ -125,5 +125,6 @@ bool PlaybackPrefs::Apply()
PrefsPanel *PlaybackPrefsFactory::Create(wxWindow *parent)
{
return new PlaybackPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew PlaybackPrefs(parent);
}

View File

@@ -64,6 +64,7 @@ class PrefsPanel:public wxPanel
class PrefsPanelFactory
{
public:
// Precondition: parent != NULL
virtual PrefsPanel *Create(wxWindow *parent) = 0;
};

View File

@@ -82,5 +82,6 @@ bool ProjectsPrefs::Apply()
PrefsPanel *ProjectsPrefsFactory::Create(wxWindow *parent)
{
return new ProjectsPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew ProjectsPrefs(parent);
}

View File

@@ -230,5 +230,6 @@ bool QualityPrefs::Apply()
PrefsPanel *QualityPrefsFactory::Create(wxWindow *parent)
{
return new QualityPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew QualityPrefs(parent);
}

View File

@@ -252,5 +252,6 @@ void RecordingPrefs::OnToggleCustomName(wxCommandEvent & Evt)
PrefsPanel *RecordingPrefsFactory::Create(wxWindow *parent)
{
return new RecordingPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew RecordingPrefs(parent);
}

View File

@@ -513,5 +513,6 @@ SpectrumPrefsFactory::SpectrumPrefsFactory(WaveTrack *wt)
PrefsPanel *SpectrumPrefsFactory::Create(wxWindow *parent)
{
return new SpectrumPrefs(parent, mWt);
wxASSERT(parent); // to justify safenew
return safenew SpectrumPrefs(parent, mWt);
}

View File

@@ -208,5 +208,6 @@ bool ThemePrefs::Apply()
PrefsPanel *ThemePrefsFactory::Create(wxWindow *parent)
{
return new ThemePrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew ThemePrefs(parent);
}

View File

@@ -164,5 +164,6 @@ bool TracksPrefs::Apply()
PrefsPanel *TracksPrefsFactory::Create(wxWindow *parent)
{
return new TracksPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew TracksPrefs(parent);
}

View File

@@ -86,5 +86,6 @@ bool WarningsPrefs::Apply()
PrefsPanel *WarningsPrefsFactory::Create(wxWindow *parent)
{
return new WarningsPrefs(parent);
wxASSERT(parent); // to justify safenew
return safenew WarningsPrefs(parent);
}

View File

@@ -244,5 +244,6 @@ WaveformPrefsFactory::WaveformPrefsFactory(WaveTrack *wt)
PrefsPanel *WaveformPrefsFactory::Create(wxWindow *parent)
{
return new WaveformPrefs(parent, mWt);
wxASSERT(parent); // to justify safenew
return safenew WaveformPrefs(parent, mWt);
}