[grilo] core: Fix crash when unloading the plugins



commit f861c709c77c731efd1f8576ed07fa301b9063b3
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue Apr 12 16:35:20 2011 +0000

    core: Fix crash when unloading the plugins
    
    Remove the plugin from the list of plugins before closing the module.
    Otherwise, the key will be freed so removing from hash table will crash.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/grl-plugin-registry.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c
index 0ce25c3..1049133 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -928,12 +928,12 @@ grl_plugin_registry_unload (GrlPluginRegistry *registry,
     plugin->plugin_deinit ();
   }
 
+  g_hash_table_remove (registry->priv->plugins, plugin_id);
+
   if (plugin->module) {
     g_module_close (plugin->module);
   }
 
-  g_hash_table_remove (registry->priv->plugins, plugin_id);
-
   return TRUE;
 }
 



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