[farsight2/master] Don't g_module_close() the transmitter plugins on unload

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:23:42 PST 2008


---
 gst-libs/gst/farsight/fs-plugin.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-plugin.c b/gst-libs/gst/farsight/fs-plugin.c
index c99b7cd..b72b15c 100644
--- a/gst-libs/gst/farsight/fs-plugin.c
+++ b/gst-libs/gst/farsight/fs-plugin.c
@@ -221,9 +221,6 @@ fs_plugin_unload (GTypeModule *module)
 
   if (plugin->unload != NULL)
     plugin->unload (plugin);
-
-  if (plugin->priv->handle != NULL)
-    g_module_close (plugin->priv->handle);
 }
 
 static FsPlugin *
@@ -305,18 +302,18 @@ fs_plugin_create_valist (const gchar *name, const gchar *type_suffix,
     plugin->name = g_strdup_printf ("%s-%s",name,type_suffix);
     g_type_module_set_name (G_TYPE_MODULE (plugin), plugin->name);
     plugins = g_list_append (plugins, plugin);
-  }
 
-  if (!g_type_module_use (G_TYPE_MODULE (plugin))) {
-    g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
-      "Could not load the %s-%s transmitter plugin", name, type_suffix);
-    return NULL;
+    /* We do the use once and then we keep it loaded forever because
+     * the gstreamer libraries can't be unloaded
+     */
+    if (!g_type_module_use (G_TYPE_MODULE (plugin))) {
+      g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
+          "Could not load the %s-%s transmitter plugin", name, type_suffix);
+      return NULL;
+    }
   }
-
   object = g_object_new_valist (plugin->type, first_property_name, var_args);
 
-  g_type_module_unuse (G_TYPE_MODULE (plugin));
-
   return object;
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list