[grilo] core: Fix double-free protection assert when unloading a plugin twice
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Fix double-free protection assert when unloading a plugin twice
- Date: Fri, 22 Feb 2013 16:37:23 +0000 (UTC)
commit 1c2a33adb18d25b9214c3a9859e72bf3bc01af0d
Author: Mike Ruprecht <mike ruprecht collabora co uk>
Date: Thu Feb 21 15:39:28 2013 -0600
core: Fix double-free protection assert when unloading a plugin twice
When calling g_module_close() twice on the same module, it throws a
g_return_if_fail() assertion stating ref_count > 0 fails. It's
effectively like g_object_unref().
This patch prevents g_module_close() being called twice on the same
module by unsetting it from the plugin instance when closing it
in grl_registry_unload_plugin().
https://bugzilla.gnome.org/show_bug.cgi?id=694390
src/grl-registry.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/grl-registry.c b/src/grl-registry.c
index e9d7e04..bab4d70 100644
--- a/src/grl-registry.c
+++ b/src/grl-registry.c
@@ -1227,6 +1227,7 @@ grl_registry_unload_plugin (GrlRegistry *registry,
if (grl_plugin_get_module (plugin)) {
g_module_close (grl_plugin_get_module (plugin));
+ grl_plugin_set_module (plugin, NULL);
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]