[CinCV-commits] CinelerraCV.git (#1541) - master (branch) updated: v2.3-89-g36659e9

git repository hosting git at cinelerra-cv.org
Sun Apr 24 19:53:29 CEST 2016


The branch, master has been updated
       via  36659e9965401a124097dd26f1ecc7443e68e5a6 (commit)
      from  9dc9b0f3ec4880ebc1d7e2cfc59b94d3233e80ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 36659e9965401a124097dd26f1ecc7443e68e5a6
Author: Einar R√ľnkaru <einarrunkaru at gmail.com>
Date:   Wed Apr 20 18:33:10 2016 +0300

    Do not delete the object of the caller function
    
    MWindow::hide_plugin is called from PluginServer::client_side_close,
    with pointer to itself. Hide_plugin deletes this object.
    Instead hide the plugin window and put it into a queue for later deleting.

-----------------------------------------------------------------------

Summary of changes:
 cinelerra/mwindow.C               |  9 +++++++--
 cinelerra/mwindow.h               |  3 ++-
 cinelerra/pluginclient.h          | 10 +++++++++-
 cinelerra/pluginserver.C          |  7 +++++++
 cinelerra/pluginserver.h          |  1 +
 plugins/1080to540/1080to540.h     |  1 -
 plugins/bandslide/bandslide.h     |  1 +
 plugins/bandwipe/bandwipe.h       |  1 +
 plugins/deinterlace/deinterlace.h |  1 -
 plugins/irissquare/irissquare.h   |  1 +
 plugins/shapewipe/shapewipe.h     |  1 +
 plugins/slide/slide.h             |  1 +
 plugins/wipe/wipe.h               |  1 +
 13 files changed, 32 insertions(+), 6 deletions(-)

The diff of changes is:
diff --git a/cinelerra/mwindow.C b/cinelerra/mwindow.C
index 96df6d6..df35622 100644
--- a/cinelerra/mwindow.C
+++ b/cinelerra/mwindow.C
@@ -194,7 +194,9 @@ SET_TRACE
 	delete cwindow;
 	delete lwindow;
 	plugin_guis->remove_all_objects();
+	removed_guis->remove_all_objects();
 	delete plugin_guis;
+	delete removed_guis;
 	delete plugin_gui_lock;
 }
 
@@ -1441,6 +1443,7 @@ SET_TRACE
 	undo = new MainUndo(this);
 
 	plugin_guis = new ArrayList<PluginServer*>;
+	removed_guis = new ArrayList<PluginServer*>;
 
 SET_TRACE
 	if(session->show_vwindow) vwindow->gui->show_window();
@@ -1770,9 +1773,9 @@ void MWindow::hide_plugin(Plugin *plugin, int lock)
 		{
 			PluginServer *ptr = plugin_guis->values[i];
 			plugin_guis->remove(ptr);
+			ptr->hide_gui();
+			removed_guis->append(ptr);
 			if(lock) plugin_gui_lock->unlock();
-// Last command executed in client side close
-			delete ptr;
 			return;
 		}
 	}
@@ -1784,6 +1787,7 @@ void MWindow::hide_plugins()
 {
 	plugin_gui_lock->lock("MWindow::hide_plugins");
 	plugin_guis->remove_all_objects();
+	removed_guis->remove_all_objects();
 	plugin_gui_lock->unlock();
 }
 
@@ -1881,6 +1885,7 @@ void MWindow::update_plugin_states()
 			i--;
 		}
 	}
+	removed_guis->remove_all_objects();
 	plugin_gui_lock->unlock();
 }
 
diff --git a/cinelerra/mwindow.h b/cinelerra/mwindow.h
index b5baa68..702883f 100644
--- a/cinelerra/mwindow.h
+++ b/cinelerra/mwindow.h
@@ -470,7 +470,8 @@ public:
 	ArrayList<PluginServer*> *plugindb;
 // Currently visible plugins
 	ArrayList<PluginServer*> *plugin_guis;
-
+// Closed plugin guis ready to remove
+       ArrayList<PluginServer*> *removed_guis;
 
 // Adjust sample position to line up with frames.
 	int fix_timing(int64_t &samples_out, 
diff --git a/cinelerra/pluginclient.h b/cinelerra/pluginclient.h
index 47e6da5..2c5cfe0 100644
--- a/cinelerra/pluginclient.h
+++ b/cinelerra/pluginclient.h
@@ -101,6 +101,7 @@ void thread_class::run() \
 /* Only set it here so tracking doesn't update it until everything is created. */ \
  	plugin->thread = this; \
 	int result = window->run_window(); \
+	window->hide_window(); \
 /* This is needed when the GUI is closed from itself */ \
 	if(result) plugin->client_side_close(); \
 }
@@ -113,6 +114,7 @@ void thread_class::run() \
 	VFrame* new_picon(); \
 	const char* plugin_title(); \
 	int show_gui(); \
+	void hide_gui(); \
 	int set_string(); \
 	void raise_window(); \
 	BC_Hash *defaults; \
@@ -150,6 +152,12 @@ int plugin_class::show_gui() \
 	thread_class *new_thread = new thread_class(this); \
 	new_thread->start(); \
 	return 0; \
+} \
+ \
+void plugin_class::hide_gui() \
+{ \
+	if(thread && thread->window) \
+		thread->window->close_event(); \
 }
 
 #define RAISE_WINDOW_MACRO(plugin_class) \
@@ -301,6 +309,7 @@ public:
 	virtual int show_gui();               
 // cause the plugin to hide the gui
 	void client_side_close();
+	virtual void hide_gui() {};
 	void update_display_title();
 // Raise the GUI
 	virtual void raise_window() {};
@@ -308,7 +317,6 @@ public:
 	virtual void save_data(KeyFrame *keyframe) {};    // write the plugin settings to text in text format
 	virtual void read_data(KeyFrame *keyframe) {};    // read the plugin settings from the text
 	int send_hide_gui();                                    // should be sent when the GUI recieves a close event from the user
-
 	int get_configure_change();                             // get propogated configuration change from a send_configure_change
 
 // Called by plugin server to update GUI with rendered data.
diff --git a/cinelerra/pluginserver.C b/cinelerra/pluginserver.C
index 6a231e7..626b78a 100644
--- a/cinelerra/pluginserver.C
+++ b/cinelerra/pluginserver.C
@@ -802,6 +802,13 @@ void PluginServer::show_gui()
 	client->show_gui();
 }
 
+void PluginServer::hide_gui()
+{
+	if(!plugin_open) return;
+	client->hide_gui();
+}
+
+
 void PluginServer::update_gui()
 {
 	if(!plugin_open || !plugin) return;
diff --git a/cinelerra/pluginserver.h b/cinelerra/pluginserver.h
index 5130f6f..89b2f55 100644
--- a/cinelerra/pluginserver.h
+++ b/cinelerra/pluginserver.h
@@ -125,6 +125,7 @@ public:
 // cause the plugin to show the GUI
 // Called by MWindow::show_plugin
 	void show_gui();          
+	void hide_gui();
 // Update GUI with keyframe settings
 	void update_gui();
 	void update_title();
diff --git a/plugins/1080to540/1080to540.h b/plugins/1080to540/1080to540.h
index 65ff70d..b5d21ea 100644
--- a/plugins/1080to540/1080to540.h
+++ b/plugins/1080to540/1080to540.h
@@ -91,7 +91,6 @@ public:
 // required for all realtime plugins
 	int process_realtime(VFrame *input, VFrame *output);
 	int is_realtime();
-	int hide_gui();
 	void update_gui();
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
diff --git a/plugins/bandslide/bandslide.h b/plugins/bandslide/bandslide.h
index c62ccc6..34ea2d5 100644
--- a/plugins/bandslide/bandslide.h
+++ b/plugins/bandslide/bandslide.h
@@ -102,6 +102,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();
diff --git a/plugins/bandwipe/bandwipe.h b/plugins/bandwipe/bandwipe.h
index ee5a9c2..e79ad48 100644
--- a/plugins/bandwipe/bandwipe.h
+++ b/plugins/bandwipe/bandwipe.h
@@ -102,6 +102,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();
diff --git a/plugins/deinterlace/deinterlace.h b/plugins/deinterlace/deinterlace.h
index 5fc7ed3..96e5a6a 100644
--- a/plugins/deinterlace/deinterlace.h
+++ b/plugins/deinterlace/deinterlace.h
@@ -80,7 +80,6 @@ public:
 		int64_t start_position,
 		double frame_rate);
 	int is_realtime();
-	int hide_gui();
 	void update_gui();
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
diff --git a/plugins/irissquare/irissquare.h b/plugins/irissquare/irissquare.h
index 9e19cf7..dd21141 100644
--- a/plugins/irissquare/irissquare.h
+++ b/plugins/irissquare/irissquare.h
@@ -89,6 +89,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();
diff --git a/plugins/shapewipe/shapewipe.h b/plugins/shapewipe/shapewipe.h
index a51be01..d61b89e 100644
--- a/plugins/shapewipe/shapewipe.h
+++ b/plugins/shapewipe/shapewipe.h
@@ -144,6 +144,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();
diff --git a/plugins/slide/slide.h b/plugins/slide/slide.h
index c95c943..414b87c 100644
--- a/plugins/slide/slide.h
+++ b/plugins/slide/slide.h
@@ -116,6 +116,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();
diff --git a/plugins/wipe/wipe.h b/plugins/wipe/wipe.h
index b47dc67..5771051 100644
--- a/plugins/wipe/wipe.h
+++ b/plugins/wipe/wipe.h
@@ -89,6 +89,7 @@ public:
 	void save_data(KeyFrame *keyframe);
 	void read_data(KeyFrame *keyframe);
 	int show_gui();
+	void hide_gui();
 	void raise_window();
 	int uses_gui();
 	int is_transition();


hooks/post-receive
-- 
CinelerraCV.git (CinelerraCV)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CinelerraCV.git" (CinelerraCV).



More information about the cinelerra-commits mailing list