add resource wdw folder expanders, fix plugin close deadlock detect
[goodguy/history.git] / cinelerra-5.1 / cinelerra / pluginclient.C
index 0a690b2e673868d3e65700da5c323022f90abc91..f1fe25b9f9e90581756f5668bc12ca18c104368e 100644 (file)
@@ -201,8 +201,11 @@ PluginClient::PluginClient(PluginServer *server)
 
 PluginClient::~PluginClient()
 {
-// Delete the GUI thread.  The GUI must be hidden with hide_gui first.
-       delete thread;
+       if( thread ) {
+               hide_gui();
+               thread->join();
+               delete thread;
+       }
 
 // Virtual functions don't work here.
        if(defaults) delete defaults;
@@ -245,8 +248,6 @@ void PluginClient::hide_gui()
                thread->window->set_done(0);
 //printf("PluginClient::hide_gui %d thread->window=%p\n", __LINE__, thread->window);
                thread->window->unlock_window();
-//printf("PluginClient::delete_thread %d\n", __LINE__);
-               thread->join();
        }
 }