Browse Source

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

... Also removed some unnecessary deletes of widgets that are managed by parent
windows
darkaudacity
Paul Licameli 6 years ago
parent
commit
df6a7c5464
  1. 8
      src/FreqWindow.cpp
  2. 2
      src/Lyrics.cpp
  3. 2
      src/LyricsWindow.cpp
  4. 4
      src/Menus.cpp
  5. 18
      src/MixerBoard.cpp
  6. 6
      src/Project.cpp
  7. 4
      src/ShuttleGui.cpp
  8. 2
      src/TimeDialog.cpp
  9. 6
      src/TimerRecordDialog.cpp
  10. 3
      src/TrackPanel.cpp
  11. 1
      src/TrackPanel.h
  12. 2
      src/effects/AutoDuck.cpp
  13. 4
      src/effects/ChangeSpeed.cpp
  14. 2
      src/effects/Compressor.cpp
  15. 8
      src/effects/Contrast.cpp
  16. 2
      src/effects/DtmfGen.cpp
  17. 2
      src/effects/Effect.cpp
  18. 5
      src/effects/EffectManager.cpp
  19. 8
      src/effects/Equalization.cpp
  20. 2
      src/effects/Noise.cpp
  21. 8
      src/effects/ScienFilter.cpp
  22. 2
      src/effects/Silence.cpp
  23. 2
      src/effects/ToneGen.cpp
  24. 2
      src/effects/VST/VSTEffect.cpp
  25. 4
      src/effects/ladspa/LadspaEffect.cpp
  26. 4
      src/effects/lv2/LV2Effect.cpp
  27. 2
      src/export/Export.cpp
  28. 5
      src/export/Export.h
  29. 3
      src/export/ExportCL.cpp
  30. 11
      src/export/ExportFFmpeg.cpp
  31. 3
      src/export/ExportFLAC.cpp
  32. 3
      src/export/ExportMP2.cpp
  33. 3
      src/export/ExportMP3.cpp
  34. 3
      src/export/ExportOGG.cpp
  35. 3
      src/export/ExportPCM.cpp
  36. 3
      src/prefs/BatchPrefs.cpp
  37. 3
      src/prefs/DevicePrefs.cpp
  38. 3
      src/prefs/DirectoriesPrefs.cpp
  39. 3
      src/prefs/EffectsPrefs.cpp
  40. 3
      src/prefs/ExtImportPrefs.cpp
  41. 3
      src/prefs/GUIPrefs.cpp
  42. 3
      src/prefs/ImportExportPrefs.cpp
  43. 5
      src/prefs/KeyConfigPrefs.cpp
  44. 3
      src/prefs/LibraryPrefs.cpp
  45. 3
      src/prefs/MidiIOPrefs.cpp
  46. 5
      src/prefs/ModulePrefs.cpp
  47. 3
      src/prefs/MousePrefs.cpp
  48. 3
      src/prefs/PlaybackPrefs.cpp
  49. 1
      src/prefs/PrefsPanel.h
  50. 3
      src/prefs/ProjectsPrefs.cpp
  51. 3
      src/prefs/QualityPrefs.cpp
  52. 3
      src/prefs/RecordingPrefs.cpp
  53. 3
      src/prefs/SpectrumPrefs.cpp
  54. 3
      src/prefs/ThemePrefs.cpp
  55. 3
      src/prefs/TracksPrefs.cpp
  56. 3
      src/prefs/WarningsPrefs.cpp
  57. 3
      src/prefs/WaveformPrefs.cpp
  58. 2
      src/toolbars/EditToolBar.cpp
  59. 4
      src/toolbars/MeterToolBar.cpp
  60. 4
      src/toolbars/MixerToolBar.cpp
  61. 6
      src/toolbars/SelectionBar.cpp
  62. 8
      src/toolbars/SpectralSelectionBar.cpp
  63. 4
      src/toolbars/ToolBar.cpp
  64. 8
      src/toolbars/ToolManager.cpp
  65. 2
      src/toolbars/ToolsToolBar.cpp
  66. 4
      src/toolbars/TranscriptionToolBar.cpp
  67. 2
      src/widgets/ASlider.cpp
  68. 6
      src/widgets/ExpandingToolBar.cpp
  69. 3
      src/widgets/Grid.cpp
  70. 1
      src/widgets/Grid.h

8
src/FreqWindow.cpp

@ -277,7 +277,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.StartVerticalLay(2);
{
vRuler = new RulerPanel(this, wxID_ANY);
vRuler = safenew RulerPanel(this, wxID_ANY);
vRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
vRuler->ruler.SetOrientation(wxVERTICAL);
vRuler->ruler.SetRange(0.0, -dBRange);
@ -295,7 +295,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
}
S.EndVerticalLay();
mFreqPlot = new FreqPlot(this);
mFreqPlot = safenew FreqPlot(this);
mFreqPlot->SetMinSize(wxSize(wxDefaultCoord, FREQ_WINDOW_HEIGHT));
S.Prop(1);
S.AddWindow(mFreqPlot, wxEXPAND);
@ -344,7 +344,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.StartHorizontalLay(wxEXPAND, 0);
{
hRuler = new RulerPanel(this, wxID_ANY);
hRuler = safenew RulerPanel(this, wxID_ANY);
hRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
hRuler->ruler.SetOrientation(wxHORIZONTAL);
hRuler->ruler.SetLog(true);
@ -477,7 +477,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
S.AddSpace(5);
mProgress = new FreqGauge(this); //, wxID_ANY, wxST_SIZEGRIP);
mProgress = safenew FreqGauge(this); //, wxID_ANY, wxST_SIZEGRIP);
S.AddWindow(mProgress, wxEXPAND);
// Log-frequency axis works for spectrum plots only.

2
src/Lyrics.cpp

@ -93,7 +93,7 @@ Lyrics::Lyrics(wxWindow* parent, wxWindowID id,
this->SetBackgroundColour(*wxWHITE);
mHighlightTextCtrl =
new HighlightTextCtrl(this, -1, // wxWindow* parent, wxWindowID id,
safenew HighlightTextCtrl(this, -1, // wxWindow* parent, wxWindowID id,
wxT(""), // const wxString& value = wxT(""),
wxPoint(0, 0), // const wxPoint& pos = wxDefaultPosition,
size); // const wxSize& size = wxDefaultSize

2
src/LyricsWindow.cpp

@ -113,7 +113,7 @@ LyricsWindow::LyricsWindow(AudacityProject *parent):
//
//pToolBar->Realize();
mLyricsPanel = new Lyrics(this, -1, panelPos, panelSize);
mLyricsPanel = safenew Lyrics(this, -1, panelPos, panelSize);
//vvv Highlight style is broken in ported version.
//switch (mLyricsPanel->GetLyricsStyle())

4
src/Menus.cpp

@ -5255,7 +5255,7 @@ void AudacityProject::OnHistory()
void AudacityProject::OnKaraoke()
{
if (!mLyricsWindow)
mLyricsWindow = new LyricsWindow(this);
mLyricsWindow = safenew LyricsWindow(this);
mLyricsWindow->Show();
UpdateLyrics();
mLyricsWindow->Raise();
@ -5265,7 +5265,7 @@ void AudacityProject::OnMixerBoard()
{
if (!mMixerBoardFrame)
{
mMixerBoardFrame = new MixerBoardFrame(this);
mMixerBoardFrame = safenew MixerBoardFrame(this);
mMixerBoard = mMixerBoardFrame->mMixerBoard;
}
mMixerBoardFrame->Show();

18
src/MixerBoard.cpp

@ -209,7 +209,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
#ifdef EXPERIMENTAL_MIDI_OUT
if (mNoteTrack) {
mSlider_Gain =
new MixerTrackSlider(
safenew MixerTrackSlider(
this, ID_SLIDER_GAIN,
/* i18n-hint: title of the MIDI Velocity slider */
_("Velocity"),
@ -218,7 +218,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
} else
#endif
mSlider_Gain =
new MixerTrackSlider(
safenew MixerTrackSlider(
this, ID_SLIDER_GAIN,
/* i18n-hint: title of the Gain slider, used to adjust the volume */
_("Gain"),
@ -258,7 +258,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
ctrlSize.x--;
mSlider_Pan =
new MixerTrackSlider(
safenew MixerTrackSlider(
this, ID_SLIDER_PAN,
/* i18n-hint: Title of the Pan slider, used to move the sound left or right */
_("Pan"),
@ -271,7 +271,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
ctrlPos.y += PAN_HEIGHT + kDoubleInset;
ctrlSize.Set(mMixerBoard->mMuteSoloWidth, MUTE_SOLO_HEIGHT);
mToggleButton_Mute =
new AButton(this, ID_TOGGLEBUTTON_MUTE,
safenew AButton(this, ID_TOGGLEBUTTON_MUTE,
ctrlPos, ctrlSize,
*(mMixerBoard->mImageMuteUp), *(mMixerBoard->mImageMuteOver),
*(mMixerBoard->mImageMuteDown), *(mMixerBoard->mImageMuteDisabled),
@ -285,7 +285,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
ctrlPos.y += MUTE_SOLO_HEIGHT;
mToggleButton_Solo =
new AButton(this, ID_TOGGLEBUTTON_SOLO,
safenew AButton(this, ID_TOGGLEBUTTON_SOLO,
ctrlPos, ctrlSize,
*(mMixerBoard->mImageSoloUp), *(mMixerBoard->mImageSoloOver),
*(mMixerBoard->mImageSoloDown), *(mMixerBoard->mImageSoloDisabled),
@ -308,7 +308,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
if (mLeftTrack) {
#endif
mMeter =
new Meter(GetActiveProject(), // AudacityProject* project,
safenew Meter(GetActiveProject(), // AudacityProject* project,
this, -1, // wxWindow* parent, wxWindowID id,
false, // bool isInput
ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
@ -984,7 +984,7 @@ MixerBoard::MixerBoard(AudacityProject* pProject,
mProject = pProject;
mScrolledWindow =
new MixerBoardScrolledWindow(
safenew MixerBoardScrolledWindow(
pProject, // AudacityProject* project,
this, -1, // wxWindow* parent, wxWindowID id = -1,
this->GetClientAreaOrigin(), // const wxPoint& pos = wxDefaultPosition,
@ -1109,7 +1109,7 @@ void MixerBoard::UpdateTrackClusters()
kInset);
wxSize clusterSize(kMixerTrackClusterWidth, nClusterHeight);
pMixerTrackCluster =
new MixerTrackCluster(mScrolledWindow, this, mProject,
safenew MixerTrackCluster(mScrolledWindow, this, mProject,
(WaveTrack*)pLeftTrack, (WaveTrack*)pRightTrack,
clusterPos, clusterSize);
if (pMixerTrackCluster)
@ -1758,7 +1758,7 @@ MixerBoardFrame::MixerBoardFrame(AudacityProject* parent)
// wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT)
wxDEFAULT_FRAME_STYLE)
{
mMixerBoard = new MixerBoard(parent, this, wxDefaultPosition, kDefaultSize);
mMixerBoard = safenew MixerBoard(parent, this, wxDefaultPosition, kDefaultSize);
this->SetSizeHints(MIXER_BOARD_MIN_WIDTH, MIXER_BOARD_MIN_HEIGHT);

6
src/Project.cpp

@ -897,7 +897,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
//
// Create the horizontal ruler
//
mRuler = new AdornedRulerPanel( this,
mRuler = safenew AdornedRulerPanel( this,
wxID_ANY,
wxDefaultPosition,
wxSize( -1, AdornedRulerPanel::GetRulerHeight() ),
@ -962,8 +962,8 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
// will be given the focus even if we try to SetFocus(). By
// creating the scrollbars after the TrackPanel, we resolve
// several focus problems.
mHsbar = new ScrollBar(pPage, HSBarID, wxSB_HORIZONTAL);
mVsbar = new ScrollBar(pPage, VSBarID, wxSB_VERTICAL);
mHsbar = safenew ScrollBar(pPage, HSBarID, wxSB_HORIZONTAL);
mVsbar = safenew ScrollBar(pPage, VSBarID, wxSB_VERTICAL);
// LLL: When Audacity starts or becomes active after returning from
// another application, the first window that can accept focus

4
src/ShuttleGui.cpp

@ -2077,8 +2077,8 @@ RulerPanel * ShuttleGui::AddRulerVertical(float low, float hi, const wxString &
// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), RulerPanel);
RulerPanel * pRulerPanel;
miProp=0;
mpWind = pRulerPanel = new RulerPanel(
mpParent,
mpWind = pRulerPanel = safenew RulerPanel(
GetParent(),
miId,
wxDefaultPosition,
wxDefaultSize

2
src/TimeDialog.cpp

@ -54,7 +54,7 @@ void TimeDialog::PopulateOrExchange(ShuttleGui &S)
{
S.StartStatic(mPrompt, true);
{
mTimeCtrl = new
mTimeCtrl = safenew
NumericTextCtrl(
NumericConverter::TIME, this,
wxID_ANY,

6
src/TimerRecordDialog.cpp

@ -364,7 +364,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
S.AddWindow(m_pDatePickerCtrl_Start);
m_pTimeTextCtrl_Start = new NumericTextCtrl(
m_pTimeTextCtrl_Start = safenew NumericTextCtrl(
NumericConverter::TIME, this, ID_TIMETEXT_START);
m_pTimeTextCtrl_Start->SetName(_("Start Time"));
m_pTimeTextCtrl_Start->SetFormatString(strFormat);
@ -386,7 +386,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_End->SetName(_("End Date"));
S.AddWindow(m_pDatePickerCtrl_End);
m_pTimeTextCtrl_End = new NumericTextCtrl(
m_pTimeTextCtrl_End = safenew NumericTextCtrl(
NumericConverter::TIME, this, ID_TIMETEXT_END);
m_pTimeTextCtrl_End->SetName(_("End Time"));
m_pTimeTextCtrl_End->SetFormatString(strFormat);
@ -407,7 +407,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
* seconds.
*/
wxString strFormat1 = _("099 days 024 h 060 m 060 s");
m_pTimeTextCtrl_Duration = new NumericTextCtrl(
m_pTimeTextCtrl_Duration = safenew NumericTextCtrl(
NumericConverter::TIME, this, ID_TIMETEXT_DURATION);
m_pTimeTextCtrl_Duration->SetName(_("Duration"));
m_pTimeTextCtrl_Duration->SetFormatString(strFormat1);

3
src/TrackPanel.cpp

@ -10065,7 +10065,8 @@ static TrackPanel * TrackPanelFactory(wxWindow * parent,
TrackPanelListener * listener,
AdornedRulerPanel * ruler)
{
return new TrackPanel(
wxASSERT(parent); // to justify safenew
return safenew TrackPanel(
parent,
id,
pos,

1
src/TrackPanel.h

@ -515,6 +515,7 @@ public:
TrackPanelListener * GetListener(){ return mListener;}
AdornedRulerPanel * GetRuler(){ return mRuler;}
// JKC and here is a factory function which just does 'NEW' in standard Audacity.
// Precondition: parent != NULL
static TrackPanel *(*FactoryFunction)(wxWindow * parent,
wxWindowID id,
const wxPoint & pos,

2
src/effects/AutoDuck.cpp

@ -424,7 +424,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S)
{
S.AddSpace(0, 5);
mPanel = new EffectAutoDuckPanel(S.GetParent(), this);
mPanel = safenew EffectAutoDuckPanel(S.GetParent(), this);
S.AddWindow(mPanel);
S.AddSpace(0, 5);

4
src/effects/ChangeSpeed.cpp

@ -362,7 +362,7 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S)
{
S.AddPrompt(_("Current Length:"));
mpFromLengthCtrl = new
mpFromLengthCtrl = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,
@ -378,7 +378,7 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S)
S.AddPrompt(_("New Length:"));
mpToLengthCtrl = new
mpToLengthCtrl = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
ID_ToLength,

2
src/effects/Compressor.cpp

@ -205,7 +205,7 @@ void EffectCompressor::PopulateOrExchange(ShuttleGui & S)
S.StartHorizontalLay(wxEXPAND, true);
{
S.SetBorder(10);
mPanel = new EffectCompressorPanel(S.GetParent(),
mPanel = safenew EffectCompressorPanel(S.GetParent(),
mThresholdDB,
mNoiseFloorDB,
mRatio);

8
src/effects/Contrast.cpp

@ -226,7 +226,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
S.AddFixedText(_("&Foreground:"), false);
if (S.GetMode() == eIsCreating)
{
mForegroundStartT = new
mForegroundStartT = safenew
NumericTextCtrl(NumericConverter::TIME, this,
ID_FOREGROUNDSTART_T,
_("hh:mm:ss + hundredths"),
@ -242,7 +242,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
if (S.GetMode() == eIsCreating)
{
mForegroundEndT = new
mForegroundEndT = safenew
NumericTextCtrl(NumericConverter::TIME, this,
ID_FOREGROUNDEND_T,
_("hh:mm:ss + hundredths"),
@ -264,7 +264,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
S.AddFixedText(_("&Background:"));
if (S.GetMode() == eIsCreating)
{
mBackgroundStartT = new
mBackgroundStartT = safenew
NumericTextCtrl(NumericConverter::TIME, this,
ID_BACKGROUNDSTART_T,
_("hh:mm:ss + hundredths"),
@ -280,7 +280,7 @@ ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
if (S.GetMode() == eIsCreating)
{
mBackgroundEndT = new
mBackgroundEndT = safenew
NumericTextCtrl(NumericConverter::TIME, this,
ID_BACKGROUNDEND_T,
_("hh:mm:ss + hundredths"),

2
src/effects/DtmfGen.cpp

@ -312,7 +312,7 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S)
S.Id(ID_Amplitude).AddTextBox(_("Amplitude (0-1):"), wxT(""), 10)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mDtmfDurationT = new
mDtmfDurationT = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
ID_Duration,

2
src/effects/Effect.cpp

@ -2884,7 +2884,7 @@ bool EffectUIHost::Initialize()
wxBoxSizer *vs = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hs = new wxBoxSizer(wxHORIZONTAL);
EffectPanel *w = new EffectPanel(this);
EffectPanel *w = safenew EffectPanel(this);
// Try to give the window a sensible default/minimum size
w->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3),

5
src/effects/EffectManager.cpp

@ -342,7 +342,10 @@ EffectRack *EffectManager::GetRack()
{
if (!mRack)
{
mRack = new EffectRack();
// EffectRack is constructed with the current project as owner, so safenew is OK
mRack = safenew EffectRack();
// Make sure what I just commented remains true:
wxASSERT(mRack->GetParent());
mRack->CenterOnParent();
}

8
src/effects/Equalization.cpp

@ -599,7 +599,7 @@ bool EffectEqualization::CloseUI()
void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
{
wxWindow *parent = S.GetParent();
wxWindow *const parent = S.GetParent();
LoadCurves();
@ -634,7 +634,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
// -------------------------------------------------------------------
S.StartVerticalLay();
{
mdBRuler = new RulerPanel(parent, wxID_ANY);
mdBRuler = safenew RulerPanel(parent, wxID_ANY);
mdBRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
mdBRuler->ruler.SetOrientation(wxVERTICAL);
mdBRuler->ruler.SetRange(60.0, -120.0);
@ -653,7 +653,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
}
S.EndVerticalLay();
mPanel = new EqualizationPanel(this, parent);
mPanel = safenew EqualizationPanel(this, parent);
S.Prop(1);
S.AddWindow(mPanel, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP);
S.SetSizeHints(wxDefaultCoord, wxDefaultCoord);
@ -687,7 +687,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
// Column 1 is empty
S.AddSpace(1, 1);
mFreqRuler = new RulerPanel(parent, wxID_ANY);
mFreqRuler = safenew RulerPanel(parent, wxID_ANY);
mFreqRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
mFreqRuler->ruler.SetOrientation(wxHORIZONTAL);
mFreqRuler->ruler.SetLog(true);

2
src/effects/Noise.cpp

@ -225,7 +225,7 @@ void EffectNoise::PopulateOrExchange(ShuttleGui & S)
S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mNoiseDurationT = new
mNoiseDurationT = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,

8
src/effects/ScienFilter.cpp

@ -363,7 +363,7 @@ bool EffectScienFilter::Init()
void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
{
wxWindow *parent = S.GetParent();
wxWindow *const parent = S.GetParent();
S.AddSpace(5);
S.SetSizerProportion(1);
@ -378,7 +378,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
S.StartVerticalLay();
{
mdBRuler = new RulerPanel(parent, wxID_ANY);
mdBRuler = safenew RulerPanel(parent, wxID_ANY);
mdBRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
mdBRuler->ruler.SetOrientation(wxVERTICAL);
mdBRuler->ruler.SetRange(30.0, -120.0);
@ -397,7 +397,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
}
S.EndVerticalLay();
mPanel = new EffectScienFilterPanel(this, parent);
mPanel = safenew EffectScienFilterPanel(this, parent);
mPanel->SetFreqRange(mLoFreq, mNyquist);
S.SetBorder(5);
@ -431,7 +431,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
S.AddSpace(1, 1);
mfreqRuler = new RulerPanel(parent, wxID_ANY);
mfreqRuler = safenew RulerPanel(parent, wxID_ANY);
mfreqRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes
mfreqRuler->ruler.SetOrientation(wxHORIZONTAL);
mfreqRuler->ruler.SetLog(true);

2
src/effects/Silence.cpp

@ -58,7 +58,7 @@ void EffectSilence::PopulateOrExchange(ShuttleGui & S)
S.StartHorizontalLay();
{
S.AddPrompt(_("Duration:"));
mDurationT = new
mDurationT = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,

2
src/effects/ToneGen.cpp

@ -395,7 +395,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
}
S.AddPrompt(_("Duration:"));
mToneDurationT = new
mToneDurationT = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,

2
src/effects/VST/VSTEffect.cpp

@ -2884,7 +2884,7 @@ void VSTEffect::BuildPlain()
{
wxControl *item = safenew wxStaticText(scroller, 0, _("Duration:"));
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
mDuration = new
mDuration = safenew
NumericTextCtrl(NumericConverter::TIME,
scroller,
ID_Duration,

4
src/effects/ladspa/LadspaEffect.cpp

@ -1196,7 +1196,7 @@ bool LadspaEffect::PopulateUI(wxWindow *parent)
{
item = safenew wxStaticText(w, 0, _("Duration:"));
gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5);
mDuration = new
mDuration = safenew
NumericTextCtrl(NumericConverter::TIME,
w,
ID_Duration,
@ -1431,7 +1431,7 @@ bool LadspaEffect::PopulateUI(wxWindow *parent)
upper = floorf(upper * 1000000.0) / 1000000.0;
mInputControls[p] = roundf(mInputControls[p] * 1000000.0) / 1000000.0;
mMeters[p] = new LadspaEffectMeter(w, mOutputControls[p], lower, upper);
mMeters[p] = safenew LadspaEffectMeter(w, mOutputControls[p], lower, upper);
mMeters[p]->SetName(labelText);
gridSizer->Add(mMeters[p], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 5);
}

4
src/effects/lv2/LV2Effect.cpp

@ -1604,7 +1604,7 @@ bool LV2Effect::BuildPlain()
wxWindow *item = safenew wxStaticText(w, 0, _("&Duration:"));
sizer->Add(item, 0, wxALIGN_CENTER | wxALL, 5);
mDuration = new
mDuration = safenew
NumericTextCtrl(NumericConverter::TIME,
w,
ID_Duration,
@ -1707,7 +1707,7 @@ bool LV2Effect::BuildPlain()
{
gridSizer->Add(1, 1, 0);
gridSizer->Add(1, 1, 0);
LV2EffectMeter *m = new LV2EffectMeter(w, ctrl);
LV2EffectMeter *m = safenew LV2EffectMeter(w, ctrl);
gridSizer->Add(m, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND);
gridSizer->Add(1, 1, 0);
}

2
src/export/Export.cpp

@ -1216,7 +1216,7 @@ ExportMixerDialog::ExportMixerDialog( TrackList *tracks, bool selectedOnly,
wxBoxSizer *vertSizer = new wxBoxSizer( wxVERTICAL );
wxWindow *mixerPanel = new ExportMixerPanel( mMixerSpec, mTrackNames, this,
wxWindow *mixerPanel = safenew ExportMixerPanel( mMixerSpec, mTrackNames, this,
ID_MIXERPANEL, wxDefaultPosition, wxSize( 400, -1 ) );
mixerPanel->SetName(_("Mixer Panel"));
vertSizer->Add( mixerPanel, 1, wxEXPAND | wxALIGN_CENTRE | wxALL, 5 );

5
src/export/Export.h

@ -83,8 +83,9 @@ public:
virtual bool IsExtension(const wxString & ext, int index);
virtual bool DisplayOptions(wxWindow *parent, int format = 0);
virtual wxWindow *OptionsCreate(wxWindow *parent, int format);
// Precondition: parent != NULL
virtual wxWindow *OptionsCreate(wxWindow *parent, int format) = 0;
virtual bool CheckFileName(wxFileName &filename, int format = 0);

3
src/export/ExportCL.cpp

@ -536,7 +536,8 @@ int ExportCL::Export(AudacityProject *project,
wxWindow *ExportCL::OptionsCreate(wxWindow *parent, int format)
{
return new ExportCLOptions(parent, format);
wxASSERT(parent); // to justify safenew
return safenew ExportCLOptions(parent, format);
}
ExportPlugin *New_ExportCL()

11
src/export/ExportFFmpeg.cpp

@ -983,27 +983,28 @@ int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate,
wxWindow *ExportFFmpeg::OptionsCreate(wxWindow *parent, int format)
{
wxASSERT(parent); // to justify safenew
// subformat index may not correspond directly to fmts[] index, convert it
mSubFormat = AdjustFormatIndex(format);
if (mSubFormat == FMT_M4A)
{
return new ExportFFmpegAACOptions(parent, format);
return safenew ExportFFmpegAACOptions(parent, format);
}
else if (mSubFormat == FMT_AC3)
{
return new ExportFFmpegAC3Options(parent, format);
return safenew ExportFFmpegAC3Options(parent, format);
}
else if (mSubFormat == FMT_AMRNB)
{
return new ExportFFmpegAMRNBOptions(parent, format);
return safenew ExportFFmpegAMRNBOptions(parent, format);
}
else if (mSubFormat == FMT_WMA2)
{
return new ExportFFmpegWMAOptions(parent, format);
return safenew ExportFFmpegWMAOptions(parent, format);
}
else if (mSubFormat == FMT_OTHER)
{
return new ExportFFmpegCustomOptions(parent, format);
return safenew ExportFFmpegCustomOptions(parent, format);
}
return ExportPlugin::OptionsCreate(parent, format);

3
src/export/ExportFLAC.cpp

@ -370,7 +370,8 @@ int ExportFLAC::Export(AudacityProject *project,
wxWindow *ExportFLAC::OptionsCreate(wxWindow *parent, int format)
{
return new ExportFLACOptions(parent, format);
wxASSERT(parent); // to justify safenew
return safenew ExportFLACOptions(parent, format);
}
// LL: There's a bug in libflac++ 1.1.2 that prevents us from using

3
src/export/ExportMP2.cpp

@ -334,7 +334,8 @@ int ExportMP2::Export(AudacityProject *project,
wxWindow *ExportMP2::OptionsCreate(wxWindow *parent, int format)
{
return new ExportMP2Options(parent, format);
wxASSERT(parent); // to justify safenew
return safenew ExportMP2Options(parent, format);
}
// returns buffer len; caller frees

3
src/export/ExportMP3.cpp

@ -1869,7 +1869,8 @@ int ExportMP3::Export(AudacityProject *project,
wxWindow *ExportMP3::OptionsCreate(wxWindow *parent, int format)
{
return new ExportMP3Options(parent, format);
wxASSERT(parent); // to justify safenew
return safenew ExportMP3Options(parent, format);
}
int ExportMP3::FindValue(CHOICES *choices, int cnt, int needle, int def)

3
src/export/ExportOGG.cpp

@ -337,7 +337,8 @@ int ExportOGG::Export(AudacityProject *project,
wxWindow *ExportOGG::OptionsCreate(wxWindow *parent, int format)
{
return new ExportOGGOptions(parent, format);
wxASSERT(parent); // to justify safenew
return safenew ExportOGGOptions(parent, format);
}
bool ExportOGG::FillComment(AudacityProject *project, vorbis_comment *comment, Tags *metadata)

3
src/export/ExportPCM.cpp

@ -877,10 +877,11 @@ void ExportPCM::AddID3Chunk(wxString fName, Tags *tags, int sf_format)
wxWindow *ExportPCM::OptionsCreate(wxWindow *parent, int format)
{
wxASSERT(parent); // to justify safenew
// default, full user control
if (format < 0 || format >= WXSIZEOF(kFormats))
{
return new ExportPCMOptions(parent, format);
return safenew ExportPCMOptions(parent, format);
}
return ExportPlugin::OptionsCreate(parent, format);

3
src/prefs/BatchPrefs.cpp

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

3
src/prefs/DevicePrefs.cpp

@ -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);
}

3
src/prefs/DirectoriesPrefs.cpp

@ -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);
}

3
src/prefs/EffectsPrefs.cpp

@ -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);
}

3
src/prefs/ExtImportPrefs.cpp

@ -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);
}

3
src/prefs/GUIPrefs.cpp

@ -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);
}

3
src/prefs/ImportExportPrefs.cpp

@ -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);
}

5
src/prefs/KeyConfigPrefs.cpp

@ -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);
}

3
src/prefs/LibraryPrefs.cpp

@ -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);
}

3
src/prefs/MidiIOPrefs.cpp

@ -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

5
src/prefs/ModulePrefs.cpp

@ -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);
}

3
src/prefs/MousePrefs.cpp

@ -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);
}

3
src/prefs/PlaybackPrefs.cpp

@ -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);
}

1
src/prefs/PrefsPanel.h

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

3
src/prefs/ProjectsPrefs.cpp

@ -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);
}

3
src/prefs/QualityPrefs.cpp

@ -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);
}

3
src/prefs/RecordingPrefs.cpp

@ -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);
}

3
src/prefs/SpectrumPrefs.cpp

@ -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);
}

3
src/prefs/ThemePrefs.cpp

@ -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);
}

3
src/prefs/TracksPrefs.cpp

@ -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);
}

3
src/prefs/WarningsPrefs.cpp

@ -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);
}

3
src/prefs/WaveformPrefs.cpp

@ -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);
}

2
src/toolbars/EditToolBar.cpp

@ -82,8 +82,6 @@ EditToolBar::EditToolBar()
EditToolBar::~EditToolBar()
{
for (int i=0; i<ETBNumButtons; i++)
delete mButtons[i];
}
void EditToolBar::Create(wxWindow * parent)

4
src/toolbars/MeterToolBar.cpp

@ -119,7 +119,7 @@ void MeterToolBar::Populate()
if( mWhichMeters & kWithRecordMeter ){
//JKC: Record on left, playback on right. Left to right flow
//(maybe we should do it differently for Arabic language :-) )
mRecordMeter = new Meter( mProject,
mRecordMeter = safenew Meter( mProject,
this,
wxID_ANY,
true,
@ -135,7 +135,7 @@ void MeterToolBar::Populate()
}
if( mWhichMeters & kWithPlayMeter ){
mPlayMeter = new Meter( mProject,
mPlayMeter = safenew Meter( mProject,
this,
wxID_ANY,
false,

4
src/toolbars/MixerToolBar.cpp

@ -84,7 +84,7 @@ void MixerToolBar::Populate()
wxID_ANY,
*mRecordBitmap), 0, wxALIGN_CENTER);
mInputSlider = new ASlider(this, wxID_ANY, _("Recording Volume"),
mInputSlider = safenew ASlider(this, wxID_ANY, _("Recording Volume"),
wxDefaultPosition, wxSize(130, 25));
mInputSlider->SetScroll(0.1f, 2.0f);
mInputSlider->SetName(_("Slider Recording"));
@ -97,7 +97,7 @@ void MixerToolBar::Populate()
wxID_ANY,
*mPlayBitmap), 0, wxALIGN_CENTER);
mOutputSlider = new ASlider(this, wxID_ANY, _("Playback Volume"),
mOutputSlider = safenew ASlider(this, wxID_ANY, _("Playback Volume"),
wxDefaultPosition, wxSize(130, 25));
mOutputSlider->SetScroll(0.1f, 2.0f);
mOutputSlider->SetName(_("Slider Playback"));

6
src/toolbars/SelectionBar.cpp

@ -251,13 +251,13 @@ void SelectionBar::Populate()
NULL,
this);
mLeftTime = new NumericTextCtrl(
mLeftTime = safenew NumericTextCtrl(
NumericConverter::TIME, this, OnLeftTimeID, formatName, 0.0, mRate);
mLeftTime->SetName(_("Selection Start:"));
mLeftTime->EnableMenu();
mainSizer->Add(mLeftTime, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
mRightTime = new NumericTextCtrl(
mRightTime = safenew NumericTextCtrl(
NumericConverter::TIME, this, OnRightTimeID, formatName, 0.0, mRate);
mRightTime->SetName(wxString(_("Selection ")) + (showSelectionLength ?
_("Length") :
@ -270,7 +270,7 @@ void SelectionBar::Populate()
wxLI_VERTICAL),
0, wxRIGHT, 5);
mAudioTime = new NumericTextCtrl(
mAudioTime = safenew NumericTextCtrl(
NumericConverter::TIME, this, wxID_ANY, formatName, 0.0, mRate);
mAudioTime->SetName(_("Audio Position:"));
mAudioTime->EnableMenu();

8
src/toolbars/SpectralSelectionBar.cpp

@ -146,28 +146,28 @@ void SpectralSelectionBar::Populate()
wxBoxSizer *subSizer = new wxBoxSizer(wxHORIZONTAL);
mCenterCtrl = new NumericTextCtrl(
mCenterCtrl = safenew NumericTextCtrl(
NumericConverter::FREQUENCY, this, OnCenterID, frequencyFormatName, 0.0);
mCenterCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
mCenterCtrl->SetName(_("Center Frequency:"));
mCenterCtrl->EnableMenu();
subSizer->Add(mCenterCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
mWidthCtrl = new NumericTextCtrl(
mWidthCtrl = safenew NumericTextCtrl(
NumericConverter::BANDWIDTH, this, OnWidthID, bandwidthFormatName, 0.0);
mWidthCtrl->SetInvalidValue(-1.0);
mWidthCtrl->SetName(wxString(_("Bandwidth:")));
mWidthCtrl->EnableMenu();
subSizer->Add(mWidthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
mLowCtrl = new NumericTextCtrl(
mLowCtrl = safenew NumericTextCtrl(
NumericConverter::FREQUENCY, this, OnLowID, frequencyFormatName, 0.0);
mLowCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
mLowCtrl->SetName(_("Low Frequency:"));
mLowCtrl->EnableMenu();
subSizer->Add(mLowCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
mHighCtrl = new NumericTextCtrl(
mHighCtrl = safenew NumericTextCtrl(
NumericConverter::FREQUENCY, this, OnHighID, frequencyFormatName, 0.0);
mHighCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
mHighCtrl->SetName(wxString(_("High Frequency:")));

4
src/toolbars/ToolBar.cpp

@ -426,7 +426,7 @@ void ToolBar::ReCreateButtons()
wxBoxSizer *ms = new wxBoxSizer( wxHORIZONTAL );
// Create the grabber and add it to the main sizer
mGrabber = new Grabber( this, mType );
mGrabber = safenew Grabber( this, mType );
ms->Add( mGrabber, 0, wxEXPAND | wxALIGN_LEFT | wxALIGN_TOP | wxRIGHT, 1 );
// Use a box sizer for laying out controls
@ -443,7 +443,7 @@ void ToolBar::ReCreateButtons()
if( IsResizable() )
{
// Create the resizer and add it to the main sizer
mResizer = new ToolBarResizer( this );
mResizer = safenew ToolBarResizer( this );
ms->Add( mResizer, 0, wxEXPAND | wxALIGN_TOP | wxLEFT, 1 );
mResizer->SetToolTip( _("Click and drag to resize toolbar") );
}

8
src/toolbars/ToolManager.cpp

@ -402,8 +402,8 @@ ToolManager::ToolManager( AudacityProject *parent )
this );
// Create the top and bottom docks
mTopDock = new ToolDock( this, mParent, TopDockID );
mBotDock = new ToolDock( this, mParent, BotDockID );
mTopDock = safenew ToolDock( this, mParent, TopDockID );
mBotDock = safenew ToolDock( this, mParent, BotDockID );
// Create all of the toolbars
mBars[ ToolsBarID ] = new ToolsToolBar();
@ -542,7 +542,7 @@ void ToolManager::Reset()
// Maybe construct a NEW floater
// this happens if we have just been bounced out of a dock.
if( floater == NULL ) {
floater = new ToolFrame( mParent, this, bar, wxPoint(-1,-1) );
floater = safenew ToolFrame( mParent, this, bar, wxPoint(-1,-1) );
bar->Reparent( floater );
}
@ -710,7 +710,7 @@ void ToolManager::ReadConfig()
// Construct a NEW floater
ToolFrame *f = new ToolFrame( mParent, this, bar, wxPoint( x, y ) );
ToolFrame *f = safenew ToolFrame( mParent, this, bar, wxPoint( x, y ) );
// Set the width and height
if( width[ ndx ] != -1 && height[ ndx ] != -1 )

2
src/toolbars/ToolsToolBar.cpp

@ -124,8 +124,6 @@ ToolsToolBar::ToolsToolBar()
ToolsToolBar::~ToolsToolBar()
{
for (int i = 0; i < 5; i++)
delete mTool[i];
}
void ToolsToolBar::RegenerateToolsTooltips()

4
src/toolbars/TranscriptionToolBar.cpp

@ -193,7 +193,7 @@ void TranscriptionToolBar::Populate()
//Add a slider that controls the speed of playback.
const int SliderWidth=100;
mPlaySpeedSlider = new ASlider(this,
mPlaySpeedSlider = safenew ASlider(this,
TTB_PlaySpeedSlider,
_("Playback Speed"),
wxDefaultPosition,
@ -236,7 +236,7 @@ void TranscriptionToolBar::Populate()
AddButton(bmpTnCalibrate, bmpTnCalibrateDisabled, TTB_Calibrate,
TRANSLATABLE("Calibrate voicekey"));
mSensitivitySlider = new ASlider(this,
mSensitivitySlider = safenew ASlider(this,
TTB_SensitivitySlider,
TRANSLATABLE("Adjust Sensitivity"),
wxDefaultPosition,

2
src/widgets/ASlider.cpp

@ -202,7 +202,7 @@ SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id,
15);
mTextCtrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
mSlider = new ASlider(this,
mSlider = safenew ASlider(this,
wxID_ANY,
title,
wxDefaultPosition,

6
src/widgets/ExpandingToolBar.cpp

@ -145,7 +145,7 @@ ExpandingToolBar::ExpandingToolBar(wxWindow* parent,
ToolBarArea *toolBarParent =
dynamic_cast<ToolBarArea *>(GetParent());
if (toolBarParent)
mGrabber = new ToolBarGrabber(this, -1, this);
mGrabber = safenew ToolBarGrabber(this, -1, this);
/// \todo check whether this is a memory leak (and check similar code)
wxImage hbar = theTheme.Image(bmpToolBarToggle);
@ -542,7 +542,7 @@ void ExpandingToolBar::StartMoving()
ImageRoll tgtImageRoll = ImageRoll(ImageRoll::VerticalRoll,
tgtImage,
magicColor);
mTargetPanel = new ImageRollPanel(mAreaParent, -1, tgtImageRoll,
mTargetPanel = safenew ImageRollPanel(mAreaParent, -1, tgtImageRoll,
wxDefaultPosition,
wxDefaultSize,
wxTRANSPARENT_WINDOW);
@ -622,7 +622,7 @@ void ExpandingToolBar::FinishMoving()
if (!mAreaParent || !mSavedArrangement)
return;
delete mTargetPanel;
// DELETE mTargetPanel; // I think this is not needed, but unreachable anyway -- PRL
mAreaParent->SetCapturedChild(NULL);

3
src/widgets/Grid.cpp

@ -44,7 +44,8 @@ TimeEditor::~TimeEditor()
void TimeEditor::Create(wxWindow *parent, wxWindowID id, wxEvtHandler *handler)
{
m_control = new NumericTextCtrl(NumericConverter::TIME, parent,
wxASSERT(parent); // to justify safenew
m_control = safenew NumericTextCtrl(NumericConverter::TIME, parent,
wxID_ANY,
mFormat,
mOld,

1
src/widgets/Grid.h

@ -45,6 +45,7 @@ class TimeEditor:public wxGridCellEditor
~TimeEditor();
// Precondition: parent != NULL
void Create(wxWindow *parent, wxWindowID id, wxEvtHandler *handler);
bool IsAcceptedKey(wxKeyEvent &event);

Loading…
Cancel
Save