about summary refs log tree commit diff
path: root/src/devices/nm-device-factory.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-05-11 17:09:14 +0200
committerMichael Biebl <biebl@debian.org>2016-05-11 17:09:14 +0200
commitc74718aa5a356199a1ff957b2579153d54be9dd5 (patch)
treecf3ade8c1e7322792ec140f09ee5e083382c5c48 /src/devices/nm-device-factory.c
parent6bb523977deede318916fe01c78f776d215cebff (diff)
parent73e152af6e3fb4f5848bfb8394484026ff119003 (diff)
Merge tag 'upstream/1.2.2'
Upstream version 1.2.2
Diffstat (limited to 'src/devices/nm-device-factory.c')
-rw-r--r--src/devices/nm-device-factory.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index 482eb185..7873756f 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -512,20 +512,20 @@ nm_device_factory_manager_load_factories (NMDeviceFactoryManagerFactoryFunc call
 			continue;
 		}
 
+		/* after loading glib types from the plugin, we cannot unload the library anymore.
+		 * Make it resident. */
+		g_module_make_resident (plugin);
+
 		factory = create_func (&error);
 		if (!factory) {
 			nm_log_warn (LOGD_HW, "(%s): failed to initialize device factory: %s",
 			             item, NM_G_ERROR_MSG (error));
 			g_clear_error (&error);
-			g_module_close (plugin);
 			continue;
 		}
 		g_clear_error (&error);
 
-		if (_add_factory (factory, TRUE, g_module_name (plugin), callback, user_data))
-			g_module_make_resident (plugin);
-		else
-			g_module_close (plugin);
+		_add_factory (factory, TRUE, g_module_name (plugin), callback, user_data);
 
 		g_object_unref (factory);
 	}