module_chain = NULL;
module_next = &module_chain;
gm = g_module_open(pathname,0);
- g_free(pathname);
+ g_free(pathname);
if(gm != NULL) break;
LttvLibrary *lttv_library_load(char *name, GError **error)
{
- LttvLibrary *l = library_load(name, error);
- l->info.load_count++;
+ LttvLibrary *l = library_load(name, error);
+ if(l != NULL) l->info.load_count++;
return l;
}
void lttv_library_unload(LttvLibrary *l)
{
- l->info.load_count--;
+ /* In the case where we wait for a module to release, the load count is 0
+ * and should not be decremented. */
+ if(l->info.load_count != 0) l->info.load_count--;
library_unload(l);
}
}
-void lttv_library_path_add(char *name)
+void lttv_library_path_add(const char *name)
{
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Add library path %s", name);
g_ptr_array_add(library_paths,(char*)g_strdup(name));
}
-void lttv_library_path_remove(char *name)
+void lttv_library_path_remove(const char *name)
{
guint i;