[Xfce4-commits] <parole:master> Fix loader plugin load (bug #6032).

Ali Abdallah noreply at xfce.org
Wed Nov 25 17:34:02 CET 2009


Updating branch refs/heads/master
         to 528c8cc3e0bcdb3eeb56320a2a0abb4c10aab511 (commit)
       from 24d93ed1a3b0e1a873bf07de5277589eb4930960 (commit)

commit 528c8cc3e0bcdb3eeb56320a2a0abb4c10aab511
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Wed Nov 25 17:30:16 2009 +0100

    Fix loader plugin load (bug #6032).

 NEWS                         |    7 +++
 configure.ac.in              |    2 +-
 src/main.c                   |    1 +
 src/parole-plugin-player.c   |    2 +-
 src/parole-plugins-manager.c |   88 ++++++++++++++++++++----------------------
 src/parole-plugins-manager.h |    2 +
 6 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/NEWS b/NEWS
index 6e384b6..f0e2ec3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+1.96
+====
+- Fix the plugin loader bug, when the a plugin is asking to pack a widget
+  and the plugin loader is not ready (bug #6032).
+- Exit after 60 seconds of inactivity on the browser plugin to avoid
+  any zombie process.
+
 1.95
 ====
 - Use taglib when compiled to get the media title and display it in
diff --git a/configure.ac.in b/configure.ac.in
index 5de93b8..6a1f2c5 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -3,7 +3,7 @@ m4_define([parole_verinfo],  [0:2:0])
 m4_define([parole_version_api],  [0])
 m4_define([parole_version_major],  [0])
 m4_define([parole_version_minor],  [1])
-m4_define([parole_version_micro],  [95])
+m4_define([parole_version_micro],  [96])
 m4_define([parole_version_build],  [@REVISION@])
 m4_define([parole_version_tag], [])
 m4_define([parole_version], [parole_version_major().parole_version_minor().parole_version_micro()ifelse(parole_version_tag(), [git], [parole_version_tag().parole_version_build()], [parole_version_tag()])])
diff --git a/src/main.c b/src/main.c
index 882dd9c..803c06e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -319,6 +319,7 @@ int main (int argc, char **argv)
 	}
 
 	plugins = parole_plugins_manager_new (!no_plugins);
+	parole_plugins_manager_load (plugins);
 	g_object_unref (builder);
 	
 	gdk_notify_startup_complete ();
diff --git a/src/parole-plugin-player.c b/src/parole-plugin-player.c
index 8d0a739..4dc5990 100644
--- a/src/parole-plugin-player.c
+++ b/src/parole-plugin-player.c
@@ -231,7 +231,7 @@ parole_plugin_player_finalize (GObject *object)
 	    g_signal_handler_disconnect (player->priv->gst, player->priv->tag_message);
     }
     
-    if ( player->priv->box )
+    if ( player->priv->packed && GTK_IS_WIDGET (player->priv->box))
 	gtk_widget_destroy (player->priv->box);
 
     G_OBJECT_CLASS (parole_plugin_player_parent_class)->finalize (object);
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index b6ab3ab..a30faf2 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -584,57 +584,11 @@ parole_plugins_manager_load_plugins (ParolePluginsManager *manager)
 }
 
 static void
-parole_plugins_manager_construct (GObject *object)
-{
-    ParolePluginsManager *manager;
-    GDir *dir;
-    GError *error = NULL;
-    const gchar *name;
-    
-    manager = PAROLE_PLUGINS_MANAGER (object);
-    
-    dir = g_dir_open (PAROLE_PLUGINS_DATA_DIR, 0, &error);
-    
-    if ( error )
-    {
-	g_critical ("Error opening plugins data dir: %s", error->message);
-	g_error_free (error);
-	return;
-    }
-    
-    while ( (name = g_dir_read_name (dir) ))
-    {
-	gchar *library_name;
-	gchar *desktop_file;
-    
-	desktop_file = g_build_filename (PAROLE_PLUGINS_DATA_DIR, name, NULL);
-	library_name = parole_plugins_manager_get_module_name (desktop_file);
-	
-	if ( library_name )
-	{
-	    gchar *library_path;
-	    ParoleProviderModule *module;
-	    library_path = g_build_filename (PAROLE_PLUGINS_DIR, library_name, NULL);
-	    module = parole_provider_module_new (library_path, desktop_file);
-	    g_ptr_array_add (manager->priv->array, module);
-	    g_free (library_name);
-	    g_free (library_path);
-	}
-	g_free (desktop_file);
-    }
-    g_dir_close (dir);
-    
-    if ( manager->priv->load_plugins )
-	parole_plugins_manager_load_plugins (manager);
-}
-
-static void
 parole_plugins_manager_class_init (ParolePluginsManagerClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
     object_class->finalize     = parole_plugins_manager_finalize;
-    object_class->constructed  = parole_plugins_manager_construct;
     object_class->set_property = parole_plugins_manager_set_property;
     object_class->get_property = parole_plugins_manager_get_property;
     
@@ -728,6 +682,48 @@ parole_plugins_manager_get (void)
     return PAROLE_PLUGINS_MANAGER (parole_plugins_manager_object);
 }
 
+void parole_plugins_manager_load (ParolePluginsManager *manager)
+{
+    GDir *dir;
+    GError *error = NULL;
+    const gchar *name;
+    
+    dir = g_dir_open (PAROLE_PLUGINS_DATA_DIR, 0, &error);
+    
+    if ( error )
+    {
+	g_critical ("Error opening plugins data dir: %s", error->message);
+	g_error_free (error);
+	return;
+    }
+    
+    while ( (name = g_dir_read_name (dir) ))
+    {
+	gchar *library_name;
+	gchar *desktop_file;
+    
+	desktop_file = g_build_filename (PAROLE_PLUGINS_DATA_DIR, name, NULL);
+	library_name = parole_plugins_manager_get_module_name (desktop_file);
+	
+	if ( library_name )
+	{
+	    gchar *library_path;
+	    ParoleProviderModule *module;
+	    library_path = g_build_filename (PAROLE_PLUGINS_DIR, library_name, NULL);
+	    module = parole_provider_module_new (library_path, desktop_file);
+	    g_ptr_array_add (manager->priv->array, module);
+	    g_free (library_name);
+	    g_free (library_path);
+	}
+	g_free (desktop_file);
+    }
+    g_dir_close (dir);
+    
+    if ( manager->priv->load_plugins )
+	parole_plugins_manager_load_plugins (manager);
+    
+}
+
 void 
 parole_plugins_manager_pack (ParolePluginsManager *manager, GtkWidget *widget, const gchar *title, ParolePluginContainer container)
 {
diff --git a/src/parole-plugins-manager.h b/src/parole-plugins-manager.h
index ec22070..32a0514 100644
--- a/src/parole-plugins-manager.h
+++ b/src/parole-plugins-manager.h
@@ -51,6 +51,8 @@ ParolePluginsManager               *parole_plugins_manager_new            (gbool
 
 ParolePluginsManager 		   *parole_plugins_manager_get 		  (void);
 
+void				    parole_plugins_manager_load		  (ParolePluginsManager *manager);
+
 void 				    parole_plugins_manager_pack 	  (ParolePluginsManager *manager, 
 									   GtkWidget *widget, 
 									   const gchar *title,



More information about the Xfce4-commits mailing list