[nautilus] module: don't access the GModule if none was returned



commit 607c8a11f41d7f1a49f67421d4b98a6edbcbcee5
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Jan 16 10:03:15 2012 -0500

    module: don't access the GModule if none was returned
    
    Before checking if the GModule pulls in ORBit, we should make sure
    g_module_open() returned a non-NULL GModule.

 libnautilus-private/nautilus-module.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libnautilus-private/nautilus-module.c b/libnautilus-private/nautilus-module.c
index 4c68cf3..7672fac 100644
--- a/libnautilus-private/nautilus-module.c
+++ b/libnautilus-private/nautilus-module.c
@@ -82,6 +82,11 @@ nautilus_module_load (GTypeModule *gmodule)
 	
 	module->library = g_module_open (module->path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
 
+	if (!module->library) {
+		g_warning ("%s", g_module_error ());
+		return FALSE;
+	}
+
 	/* ORBit installs atexit() handlers, which would get unloaded together
 	 * with the module now that the main process doesn't depend on GConf anymore,
 	 * causing nautilus to sefgault at exit.
@@ -92,11 +97,6 @@ nautilus_module_load (GTypeModule *gmodule)
 		g_module_make_resident (module->library);
         }
 
-	if (!module->library) {
-		g_warning ("%s", g_module_error ());
-		return FALSE;
-	}
-
 	if (!g_module_symbol (module->library,
 			      "nautilus_module_initialize",
 			      (gpointer *)&module->initialize) ||



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]