mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 17:49:45 +02:00
More of bug 1338: avoid Mac hang with modal invocation of plugin...
... This required a separate set of changes and testing for the VST version of SPAN, another for the AU version. see commit c8e570797f1e7c76750b4a8f24d4fb97c612f7e6
This commit is contained in:
parent
6ce85bee9a
commit
54afdc762f
@ -35,6 +35,7 @@ public:
|
||||
~VSTControl();
|
||||
|
||||
bool Create(wxWindow *parent, VSTEffectLink *link);
|
||||
void Close();
|
||||
|
||||
private:
|
||||
void CreateCocoa();
|
||||
|
@ -65,6 +65,11 @@ VSTControl::VSTControl()
|
||||
}
|
||||
|
||||
VSTControl::~VSTControl()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void VSTControl::Close()
|
||||
{
|
||||
#if !defined(_LP64)
|
||||
if (mWindowRef)
|
||||
|
@ -1762,6 +1762,7 @@ bool VSTEffect::CloseUI()
|
||||
#ifdef __WX_EVTLOOP_BUSY_WAITING__
|
||||
wxEventLoop::SetBusyWaiting(false);
|
||||
#endif
|
||||
mControl->Close();
|
||||
#endif
|
||||
|
||||
mParent->RemoveEventHandler(this);
|
||||
|
@ -33,6 +33,8 @@ public:
|
||||
AUControl();
|
||||
~AUControl();
|
||||
|
||||
void Close();
|
||||
|
||||
bool Create(wxWindow *parent, AudioComponent comp, AudioUnit unit, bool custom);
|
||||
void CreateCocoa();
|
||||
void CreateGeneric();
|
||||
|
@ -107,12 +107,18 @@ AUControl::AUControl()
|
||||
}
|
||||
|
||||
AUControl::~AUControl()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void AUControl::Close()
|
||||
{
|
||||
#if !defined(_LP64)
|
||||
|
||||
if (mInstance)
|
||||
{
|
||||
AudioComponentInstanceDispose(mInstance);
|
||||
mInstance = nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -125,11 +131,13 @@ AUControl::~AUControl()
|
||||
object:mView];
|
||||
|
||||
[mView release];
|
||||
mView = nullptr;
|
||||
}
|
||||
|
||||
if (mAUView)
|
||||
{
|
||||
[mAUView release];
|
||||
mAUView = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1747,7 +1747,7 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent)
|
||||
{
|
||||
auto innerSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
|
||||
innerSizer->Add(pControl.release(), 1, wxEXPAND);
|
||||
innerSizer->Add((mpControl = pControl.release()), 1, wxEXPAND);
|
||||
container->SetSizer(innerSizer.release());
|
||||
}
|
||||
|
||||
@ -1808,6 +1808,8 @@ bool AudioUnitEffect::CloseUI()
|
||||
#ifdef __WX_EVTLOOP_BUSY_WAITING__
|
||||
wxEventLoop::SetBusyWaiting(false);
|
||||
#endif
|
||||
if (mpControl)
|
||||
mpControl->Close(), mpControl = nullptr;
|
||||
#endif
|
||||
|
||||
mParent->RemoveEventHandler(this);
|
||||
|
@ -211,6 +211,8 @@ private:
|
||||
|
||||
AUEventListenerRef mEventListenerRef;
|
||||
|
||||
AUControl *mpControl{};
|
||||
|
||||
friend class AudioUnitEffectExportDialog;
|
||||
friend class AudioUnitEffectImportDialog;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user