Use the new lazy loading of modules for gio modules

This commit is contained in:
Alexander Larsson 2010-01-12 11:57:17 +01:00
parent 488bede191
commit 682b3da99b

View File

@ -534,7 +534,6 @@ _g_io_modules_ensure_extension_points_registered (void)
void void
_g_io_modules_ensure_loaded (void) _g_io_modules_ensure_loaded (void)
{ {
GList *modules, *l;
static gboolean loaded_dirs = FALSE; static gboolean loaded_dirs = FALSE;
const char *module_path; const char *module_path;
@ -546,21 +545,19 @@ _g_io_modules_ensure_loaded (void)
{ {
loaded_dirs = TRUE; loaded_dirs = TRUE;
modules = g_io_modules_load_all_in_directory (GIO_MODULE_DIR); g_io_modules_scan_all_in_directory (GIO_MODULE_DIR);
module_path = g_getenv ("GIO_EXTRA_MODULES"); module_path = g_getenv ("GIO_EXTRA_MODULES");
if (module_path) if (module_path)
{ {
int i = 0;
gchar **paths; gchar **paths;
int i;
paths = g_strsplit (module_path, ":", 0); paths = g_strsplit (module_path, ":", 0);
while (paths[i] != NULL) for (i = 0; paths[i] != NULL; i++)
{ g_io_modules_scan_all_in_directory (paths[i]);
modules = g_list_concat (modules, g_io_modules_load_all_in_directory (paths[i]));
i++;
}
g_strfreev (paths); g_strfreev (paths);
} }
@ -585,11 +582,6 @@ _g_io_modules_ensure_loaded (void)
_g_winhttp_vfs_get_type (); _g_winhttp_vfs_get_type ();
#endif #endif
_g_local_vfs_get_type (); _g_local_vfs_get_type ();
for (l = modules; l != NULL; l = l->next)
g_type_module_unuse (G_TYPE_MODULE (l->data));
g_list_free (modules);
} }
G_UNLOCK (loaded_dirs); G_UNLOCK (loaded_dirs);