From 1e3dcdec0d1a3b65d5a99dd998978dbe5db53dc8 Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Mon, 24 Feb 2014 00:56:40 +0200 Subject: [PATCH 1/2] RemoteVstPlugin: close the plugin properly --- plugins/vst_base/RemoteVstPlugin.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 1c0c66c6e..002c083fa 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -418,6 +418,15 @@ RemoteVstPlugin::RemoteVstPlugin( key_t _shm_in, key_t _shm_out ) : RemoteVstPlugin::~RemoteVstPlugin() { + if( m_window != NULL ) + { + pluginDispatch( effEditClose ); +#ifdef LMMS_BUILD_LINUX + CloseWindow( m_window ); +#endif + m_window = NULL; + } + pluginDispatch( effMainsChanged, 0, 0 ); #ifndef USE_QT_SHMEM // detach shared memory segment if( shmdt( m_vstSyncData ) == -1) @@ -433,14 +442,6 @@ RemoteVstPlugin::~RemoteVstPlugin() } } #endif - if( m_window != NULL ) - { - pluginDispatch( effEditClose ); -#ifdef LMMS_BUILD_LINUX - CloseWindow( m_window ); -#endif - m_window = NULL; - } if( m_libInst != NULL ) { From a34a0932d145168f33eb29697afc7e2496403bae Mon Sep 17 00:00:00 2001 From: Hannu Haahti Date: Mon, 24 Feb 2014 00:57:03 +0200 Subject: [PATCH 2/2] RemoteVstPlugin: don't mess with plugin internals --- plugins/vst_base/RemoteVstPlugin.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 002c083fa..5c7f807c9 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -739,8 +739,6 @@ bool RemoteVstPlugin::load( const std::string & _plugin_file ) return false; } - m_plugin->user = this; - if( m_plugin->magic != kEffectMagic ) { debugMessage( "File is not a VST plugin\n" );