mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Sizers are owned by wxWindow objects when added, so use safenew, or...
... use unique_ptr in the interim between building them and adding. This checks eliminates some naked news, which were not paired with deletes.
This commit is contained in:
@@ -1212,34 +1212,41 @@ ExportMixerDialog::ExportMixerDialog( TrackList *tracks, bool selectedOnly,
|
||||
if (maxNumChannels > 32)
|
||||
maxNumChannels = 32;
|
||||
|
||||
mMixerSpec = new MixerSpec( numTracks, maxNumChannels );
|
||||
mMixerSpec = new MixerSpec(numTracks, maxNumChannels);
|
||||
|
||||
wxBoxSizer *vertSizer;
|
||||
{
|
||||
auto uVertSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
vertSizer = uVertSizer.get();
|
||||
|
||||
wxBoxSizer *vertSizer = new wxBoxSizer( wxVERTICAL );
|
||||
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);
|
||||
|
||||
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 );
|
||||
{
|
||||
auto horSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
|
||||
|
||||
wxBoxSizer *horSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxString label;
|
||||
label.Printf(_("Output Channels: %2d"), mMixerSpec->GetNumChannels());
|
||||
mChannelsText = safenew wxStaticText(this, -1, label);
|
||||
horSizer->Add(mChannelsText, 0, wxALIGN_LEFT | wxALL, 5);
|
||||
|
||||
wxString label;
|
||||
label.Printf( _( "Output Channels: %2d" ), mMixerSpec->GetNumChannels() );
|
||||
mChannelsText = safenew wxStaticText(this, -1, label);
|
||||
horSizer->Add( mChannelsText, 0, wxALIGN_LEFT | wxALL, 5 );
|
||||
wxSlider *channels = safenew wxSlider(this, ID_SLIDER_CHANNEL,
|
||||
mMixerSpec->GetNumChannels(), 1, mMixerSpec->GetMaxNumChannels(),
|
||||
wxDefaultPosition, wxSize(300, -1));
|
||||
channels->SetName(label);
|
||||
horSizer->Add(channels, 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
wxSlider *channels = safenew wxSlider( this, ID_SLIDER_CHANNEL,
|
||||
mMixerSpec->GetNumChannels(), 1, mMixerSpec->GetMaxNumChannels(),
|
||||
wxDefaultPosition, wxSize( 300, -1 ) );
|
||||
channels->SetName(label);
|
||||
horSizer->Add( channels, 0, wxEXPAND | wxALL, 5 );
|
||||
vertSizer->Add(horSizer.release(), 0, wxALIGN_CENTRE | wxALL, 5);
|
||||
}
|
||||
|
||||
vertSizer->Add( horSizer, 0, wxALIGN_CENTRE | wxALL, 5 );
|
||||
vertSizer->Add(CreateStdButtonSizer(this, eCancelButton | eOkButton).release(), 0, wxEXPAND);
|
||||
|
||||
vertSizer->Add( CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND );
|
||||
SetAutoLayout(true);
|
||||
SetSizer(uVertSizer.release());
|
||||
}
|
||||
|
||||
SetAutoLayout( true );
|
||||
SetSizer( vertSizer );
|
||||
vertSizer->Fit( this );
|
||||
vertSizer->SetSizeHints( this );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user