X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fmwindow.C;fp=cinelerra-5.0%2Fcinelerra%2Fmwindow.C;h=27a6d76bc85dcf561cb492cbe80d6648b6c536da;hb=9af59e88f3b08deff2567228e1796189cba44c8c;hp=18488f84685bb66ff3b521306229639cd6a43315;hpb=32ee2ceae89bbd4714cade28d0728593fdcaa78a;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/mwindow.C b/cinelerra-5.0/cinelerra/mwindow.C index 18488f84..27a6d76b 100644 --- a/cinelerra-5.0/cinelerra/mwindow.C +++ b/cinelerra-5.0/cinelerra/mwindow.C @@ -279,7 +279,6 @@ MWindow::~MWindow() join(); #endif reset_caches(); - delete_plugins(); dead_plugins->remove_all(); finit_error(); keyframe_threads->remove_all_objects(); @@ -311,6 +310,7 @@ MWindow::~MWindow() delete assets; assets = 0; delete splash_window; splash_window = 0; delete theme; theme = 0; + delete_plugins(); delete channeldb_buz; delete channeldb_v4l2jpeg; // This must be last thread to exit @@ -446,24 +446,22 @@ void MWindow::init_plugin_index(MWindow *mwindow, Preferences *preferences, FILE continue; } if( plugin_exists(plugin_path) ) continue; - PluginServer *server = new PluginServer(mwindow, plugin_path, PLUGIN_TYPE_UNKNOWN); - result = server->open_plugin(1, preferences, 0, 0); + PluginServer server(mwindow, plugin_path, PLUGIN_TYPE_UNKNOWN); + result = server.open_plugin(1, preferences, 0, 0); if( !result ) { - server->write_table(fp,vis_id); - server->close_plugin(); - server->delete_this(); - continue; + server.write_table(fp,vis_id); + server.close_plugin(); } - if( result != PLUGINSERVER_IS_LAD ) continue; - int lad_index = 0; - for(;;) { - PluginServer *server = new PluginServer(mwindow, plugin_path, PLUGIN_TYPE_LADSPA); - server->set_lad_index(lad_index++); - result = server->open_plugin(1, preferences, 0, 0); - if( result ) break; - server->write_table(fp, PLUGIN_LADSPA_ID); - server->close_plugin(); - server->delete_this(); + else if( result == PLUGINSERVER_IS_LAD ) { + int lad_index = 0; + for(;;) { + PluginServer ladspa(mwindow, plugin_path, PLUGIN_TYPE_LADSPA); + ladspa.set_lad_index(lad_index++); + result = ladspa.open_plugin(1, preferences, 0, 0); + if( result ) break; + ladspa.write_table(fp, PLUGIN_LADSPA_ID); + ladspa.close_plugin(); + } } } } @@ -723,17 +721,17 @@ void MWindow::init_theme() exit(1); } - PluginServer plugin = *theme_plugin; - if( plugin.open_plugin(0, preferences, 0, 0) ) { + PluginServer *plugin = new PluginServer(*theme_plugin); + if( plugin->open_plugin(0, preferences, 0, 0) ) { fprintf(stderr, _("MWindow::init_theme: unable to load theme %s\n"), theme_plugin->title); exit(1); } - theme = plugin.new_theme(); + theme = plugin->new_theme(); theme->mwindow = this; - strcpy(theme->path, plugin.path); - plugin.close_plugin(); + strcpy(theme->path, plugin->path); + delete plugin; // Load default images & settings theme->Theme::initialize();