1
0
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:
Paul Licameli 2017-07-24 16:49:15 -04:00
parent 6ce85bee9a
commit 54afdc762f
7 changed files with 22 additions and 1 deletions

View File

@ -35,6 +35,7 @@ public:
~VSTControl();
bool Create(wxWindow *parent, VSTEffectLink *link);
void Close();
private:
void CreateCocoa();

View File

@ -65,6 +65,11 @@ VSTControl::VSTControl()
}
VSTControl::~VSTControl()
{
Close();
}
void VSTControl::Close()
{
#if !defined(_LP64)
if (mWindowRef)

View File

@ -1762,6 +1762,7 @@ bool VSTEffect::CloseUI()
#ifdef __WX_EVTLOOP_BUSY_WAITING__
wxEventLoop::SetBusyWaiting(false);
#endif
mControl->Close();
#endif
mParent->RemoveEventHandler(this);

View File

@ -33,6 +33,8 @@ public:
AUControl();
~AUControl();
void Close();
bool Create(wxWindow *parent, AudioComponent comp, AudioUnit unit, bool custom);
void CreateCocoa();
void CreateGeneric();

View File

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

View File

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

View File

@ -211,6 +211,8 @@ private:
AUEventListenerRef mEventListenerRef;
AUControl *mpControl{};
friend class AudioUnitEffectExportDialog;
friend class AudioUnitEffectImportDialog;
};