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

Clone functions required by wxWidgets base classes can use safenew

This commit is contained in:
Paul Licameli
2016-03-31 01:13:29 -04:00
parent 456c8fb01e
commit 83e9e7de97
6 changed files with 22 additions and 14 deletions

View File

@@ -125,9 +125,10 @@ bool TimeEditor::IsAcceptedKey(wxKeyEvent &event)
return false;
}
// Clone is required by wxwidgets; implemented via copy constructor
wxGridCellEditor *TimeEditor::Clone() const
{
return new TimeEditor(mFormat, mRate);
return safenew TimeEditor(mFormat, mRate);
}
wxString TimeEditor::GetValue() const
@@ -246,9 +247,10 @@ wxSize TimeRenderer::GetBestSize(wxGrid &grid,
return sz;
}
// Clone is required by wxwidgets; implemented via copy constructor
wxGridCellRenderer *TimeRenderer::Clone() const
{
return new TimeRenderer();
return safenew TimeRenderer();
}
ChoiceEditor::ChoiceEditor(size_t count, const wxString choices[])
@@ -272,9 +274,10 @@ ChoiceEditor::~ChoiceEditor()
mHandler.DisconnectEvent(m_control);
}
// Clone is required by wxwidgets; implemented via copy constructor
wxGridCellEditor *ChoiceEditor::Clone() const
{
return new ChoiceEditor(mChoices);
return safenew ChoiceEditor(mChoices);
}
void ChoiceEditor::Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler)