[gnome-panel/f14/master] Prevent modules from being unloadable

Ray Strode rstrode at fedoraproject.org
Fri Sep 10 21:41:42 UTC 2010


commit 6ad321557c817d4a5d2a1fa6903d24c5d80f4fd1
Author: Ray Strode <rstrode at redhat.com>
Date:   Fri Sep 10 17:40:41 2010 -0400

    Prevent modules from being unloadable
    
    The bonobo compatibility module doesn't support unloading.
    In general, it's really hard to write a module that can be
    safely unloaded and then reloaded later. Also, there's not
    much point in supporting it for the panel's use case.  Therefore,
    we won't anymore.  That solves the bonobo issue and any future
    issues that could potentially crop up.

 dont-unload-modules.patch |   53 +++++++++++++++++++++++++++++++++++++++++++++
 gnome-panel.spec          |    9 ++++++-
 2 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/dont-unload-modules.patch b/dont-unload-modules.patch
new file mode 100644
index 0000000..cbd32b2
--- /dev/null
+++ b/dont-unload-modules.patch
@@ -0,0 +1,53 @@
+From cf3e21f6e4a3f6b2a2d260aa12a6e739221ceac3 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 10 Sep 2010 17:36:44 -0400
+Subject: [PATCH] Prevent modules from being unloadable
+
+The bonobo compatibility module doesn't support unloading.
+In general, it's really hard to write a module that can be
+safely unloaded and then reloaded later. Also, there's not
+much point in supporting it for the panel's use case.  Therefore,
+we won't anymore.  That solves the bonobo issue and any future
+issues that could potentially crop up.
+---
+ gnome-panel/panel-modules.c |   15 ++++++++++++---
+ 1 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/gnome-panel/panel-modules.c b/gnome-panel/panel-modules.c
+index 7719385..af9f6c6 100644
+--- a/gnome-panel/panel-modules.c
++++ b/gnome-panel/panel-modules.c
+@@ -55,9 +55,16 @@ panel_modules_ensure_loaded (void)
+ 	panel_modules_ensure_extension_points_registered ();
+ 
+ 	if (!loaded_dirs) {
++		GList *modules;
+ 		loaded_dirs = TRUE;
+ 
+-		g_io_modules_scan_all_in_directory (PANEL_MODULES_DIR);
++		/* We load the modules explicitly instead of using scan_all
++		 * so that we can leak a reference to them.  This prevents them
++		 * from getting unloaded later (something they aren't designed
++		 * to cope with)
++		 */
++		modules = g_io_modules_load_all_in_directory (PANEL_MODULES_DIR);
++		g_list_free (modules);
+ 
+ 		module_path = g_getenv ("GNOME_PANEL_EXTRA_MODULES");
+ 
+@@ -67,8 +74,10 @@ panel_modules_ensure_loaded (void)
+ 
+ 			paths = g_strsplit (module_path, ":", 0);
+ 
+-			for (i = 0; paths[i] != NULL; i++)
+-				g_io_modules_scan_all_in_directory (paths[i]);
++			for (i = 0; paths[i] != NULL; i++) {
++				modules = g_io_modules_load_all_in_directory (paths[i]);
++				g_list_free (modules);
++			}
+ 
+ 			g_strfreev (paths);
+ 		}
+-- 
+1.7.2.3
+
diff --git a/gnome-panel.spec b/gnome-panel.spec
index bf8a4df..c1054ab 100644
--- a/gnome-panel.spec
+++ b/gnome-panel.spec
@@ -22,7 +22,7 @@
 Summary: GNOME panel
 Name: gnome-panel
 Version: 2.31.90
-Release: 3%{?dist}
+Release: 4%{?dist}
 URL: http://www.gnome.org
 #VCS: git:git://git.gnome.org/gnome-panel
 Source0: http://download.gnome.org/sources/gnome-panel/2.31/%{name}-%{version}.tar.bz2
@@ -125,6 +125,9 @@ Patch47: fix-clock-crash.patch
 
 Patch48: gnome-panel-libs.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=621413
+Patch49: dont-unload-modules.patch
+
 Conflicts: gnome-power-manager < 2.15.3
 
 %description
@@ -172,6 +175,7 @@ Panel Applets using the libpanel-applet library.
 %patch45 -p1 -b .icon-padding
 %patch47 -p1 -b .fix-clock-crash
 %patch48 -p1 -b .libs
+%patch49 -p1 -b .dont-unload-modules
 
 cp -f %{SOURCE3} gnome-panel/panel-default-setup.entries
 cp -f %{SOURCE4} m4
@@ -362,6 +366,9 @@ gtk-update-icon-cache -q %{_datadir}/icons/hicolor >&/dev/null || :
 %{_datadir}/gir-1.0/PanelApplet-3.0.gir
 
 %changelog
+* Fri Sep 10 2010 Ray Strode <rstrode at redhat.com> - 2.31.90-4
+- Fix crash at shutdown
+
 * Fri Sep 10 2010 Matthias Clasen <mclasen at redhat.com> - 2.31.90-3
 - Re-add some patches to avoid errors
 


More information about the scm-commits mailing list