13
0

VST3: GUI d'tor re-order

We have to call close_view(), which calls IPlugView::removed()
before destroying the parent widget.

Previously ~VST3PluginUI() was called after the derived class
destroyed the owned private `_gui_widget`, `_ns_view` or x11 parent.

On windows that may lead to the hwnd of the window becoming invalid
before the call to ::removed().
This commit is contained in:
Robin Gareus 2020-12-14 19:29:53 +01:00
parent 0d4ab880a8
commit bbc54873ae
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 6 additions and 2 deletions

View File

@ -54,6 +54,8 @@ VST3HWNDPluginUI::VST3HWNDPluginUI (boost::shared_ptr<PluginInsert> pi, boost::s
VST3HWNDPluginUI::~VST3HWNDPluginUI () VST3HWNDPluginUI::~VST3HWNDPluginUI ()
{ {
assert (_view_realized);
_vst3->close_view ();
} }
void void

View File

@ -91,6 +91,8 @@ VST3NSViewPluginUI::VST3NSViewPluginUI (boost::shared_ptr<PluginInsert> pi, boos
VST3NSViewPluginUI::~VST3NSViewPluginUI () VST3NSViewPluginUI::~VST3NSViewPluginUI ()
{ {
assert (_view_realized);
_vst3->close_view ();
[_ns_view removeFromSuperview]; [_ns_view removeFromSuperview];
[_ns_view release]; [_ns_view release];
} }

View File

@ -56,8 +56,6 @@ VST3PluginUI::VST3PluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_pt
VST3PluginUI::~VST3PluginUI () VST3PluginUI::~VST3PluginUI ()
{ {
assert (_view_realized);
_vst3->close_view ();
} }
gint gint

View File

@ -190,6 +190,8 @@ VST3X11PluginUI::VST3X11PluginUI (boost::shared_ptr<PluginInsert> pi, boost::sha
VST3X11PluginUI::~VST3X11PluginUI () VST3X11PluginUI::~VST3X11PluginUI ()
{ {
assert (_view_realized);
_vst3->close_view ();
} }
void void