1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-09 14:43:57 +01:00

Various uses of make_unique

This commit is contained in:
Paul Licameli
2016-08-10 01:34:44 -04:00
parent 11305b956f
commit 14c23803ac
7 changed files with 23 additions and 19 deletions

View File

@@ -1778,13 +1778,13 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent)
}
else
{
mControl = new AUControl;
if (!mControl)
auto pControl = std::make_unique<AUControl>();
if (!pControl)
{
return false;
}
if (!mControl->Create(container, mComponent, mUnit, mUIType == wxT("Full")))
if (!pControl->Create(container, mComponent, mUnit, mUIType == wxT("Full")))
{
return false;
}
@@ -1792,7 +1792,7 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent)
{
auto innerSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
innerSizer->Add(mControl, 1, wxEXPAND);
innerSizer->Add(pControl.release(), 1, wxEXPAND);
container->SetSizer(innerSizer.release());
}

View File

@@ -200,7 +200,6 @@ private:
EffectUIHostInterface *mUIHost;
wxWindow *mParent;
wxDialog *mDialog;
AUControl *mControl;
wxString mUIType;
bool mIsGraphical;