Exception safety in: overrides of ShowInterface
This commit is contained in:
parent
79c3bef2ce
commit
1fad6292a2
|
@ -88,8 +88,6 @@ WX_DECLARE_VOIDPTR_HASH_MAP( bool, t2bHash );
|
|||
|
||||
Effect::Effect()
|
||||
{
|
||||
mParent = NULL;
|
||||
|
||||
mClient = NULL;
|
||||
|
||||
mTracks = NULL;
|
||||
|
@ -520,7 +518,8 @@ bool Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
|
||||
if (mUIDialog)
|
||||
{
|
||||
mUIDialog->Close(true);
|
||||
if ( mUIDialog->Close(true) )
|
||||
mUIDialog = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -529,8 +528,9 @@ bool Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
return mClient->ShowInterface(parent, forceModal);
|
||||
}
|
||||
|
||||
mParent = parent;
|
||||
|
||||
// mUIDialog is null
|
||||
auto cleanup = valueRestorer( mUIDialog );
|
||||
|
||||
mUIDialog = CreateUI(parent, this);
|
||||
if (!mUIDialog)
|
||||
{
|
||||
|
@ -544,14 +544,13 @@ bool Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
if (SupportsRealtime() && !forceModal)
|
||||
{
|
||||
mUIDialog->Show();
|
||||
cleanup.release();
|
||||
|
||||
// Return false to bypass effect processing
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = mUIDialog->ShowModal() != 0;
|
||||
mUIDialog = NULL;
|
||||
mParent = NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -1131,7 +1130,6 @@ bool Effect::DoEffect(wxWindow *parent,
|
|||
|
||||
mFactory = factory;
|
||||
mProjectRate = projectRate;
|
||||
mParent = parent;
|
||||
mTracks = list;
|
||||
|
||||
bool isSelection = false;
|
||||
|
|
|
@ -484,7 +484,6 @@ protected:
|
|||
// Used only by the base Effect class
|
||||
//
|
||||
private:
|
||||
wxWindow *mParent;
|
||||
TrackList *mTracks; // the complete list of all tracks
|
||||
|
||||
bool mIsBatch;
|
||||
|
|
|
@ -570,14 +570,10 @@ bool EffectEqualization::PopulateUI(wxWindow *parent)
|
|||
|
||||
bool EffectEqualization::CloseUI()
|
||||
{
|
||||
mUIParent->RemoveEventHandler(this);
|
||||
|
||||
mUIParent = NULL;
|
||||
|
||||
mCurve = NULL;
|
||||
mPanel = NULL;
|
||||
|
||||
return true;
|
||||
return Effect::CloseUI();
|
||||
}
|
||||
|
||||
void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
|
||||
|
|
|
@ -1544,10 +1544,14 @@ bool VSTEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
{
|
||||
if (mDialog)
|
||||
{
|
||||
mDialog->Close(true);
|
||||
if ( mDialog->Close(true) )
|
||||
mDialog = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// mDialog is null
|
||||
auto cleanup = valueRestorer( mDialog );
|
||||
|
||||
// mProcessLevel = 1; // in GUI thread
|
||||
|
||||
// Set some defaults since some VSTs need them...these will be reset when
|
||||
|
@ -1569,12 +1573,12 @@ bool VSTEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
if (SupportsRealtime() && !forceModal)
|
||||
{
|
||||
mDialog->Show();
|
||||
cleanup.release();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = mDialog->ShowModal() != 0;
|
||||
mDialog = NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -1423,10 +1423,14 @@ bool AudioUnitEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
{
|
||||
if (mDialog)
|
||||
{
|
||||
mDialog->Close(true);
|
||||
if( mDialog->Close(true) )
|
||||
mDialog = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// mDialog is null
|
||||
auto cleanup = valueRestorer( mDialog );
|
||||
|
||||
mDialog = mHost->CreateUI(parent, this);
|
||||
if (!mDialog)
|
||||
{
|
||||
|
@ -1436,12 +1440,12 @@ bool AudioUnitEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
if ((SupportsRealtime() || GetType() == EffectTypeAnalyze) && !forceModal)
|
||||
{
|
||||
mDialog->Show();
|
||||
cleanup.release();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = mDialog->ShowModal() != 0;
|
||||
mDialog = NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -996,10 +996,14 @@ bool LadspaEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
{
|
||||
if (mDialog)
|
||||
{
|
||||
mDialog->Close(true);
|
||||
if ( mDialog->Close(true) )
|
||||
mDialog = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// mDialog is null
|
||||
auto cleanup = valueRestorer( mDialog );
|
||||
|
||||
mDialog = mHost->CreateUI(parent, this);
|
||||
if (!mDialog)
|
||||
{
|
||||
|
@ -1013,12 +1017,12 @@ bool LadspaEffect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
if ((SupportsRealtime() || GetType() == EffectTypeAnalyze) && !forceModal)
|
||||
{
|
||||
mDialog->Show();
|
||||
cleanup.release();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = mDialog->ShowModal() != 0;
|
||||
mDialog = NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -921,10 +921,14 @@ bool LV2Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
{
|
||||
if (mDialog)
|
||||
{
|
||||
mDialog->Close(true);
|
||||
if ( mDialog->Close(true) )
|
||||
mDialog = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// mDialog is null
|
||||
auto cleanup = valueRestorer( mDialog );
|
||||
|
||||
mDialog = mHost->CreateUI(parent, this);
|
||||
if (!mDialog)
|
||||
{
|
||||
|
@ -939,12 +943,12 @@ bool LV2Effect::ShowInterface(wxWindow *parent, bool forceModal)
|
|||
if ((SupportsRealtime() || GetType() == EffectTypeAnalyze) && !forceModal)
|
||||
{
|
||||
mDialog->Show();
|
||||
cleanup.release();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool res = mDialog->ShowModal() != 0;
|
||||
mDialog = NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue