- static gsize backend;
-
- if (g_once_init_enter (&backend))
- {
- GSettingsBackend *instance;
- GIOExtensionPoint *point;
- GIOExtension *extension;
- GType extension_type;
- GList *extensions;
- const gchar *env;
-
- _g_io_modules_ensure_loaded ();
-
- point = g_io_extension_point_lookup (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME);
- extension = NULL;
-
- if ((env = getenv ("GSETTINGS_BACKEND")))
- {
- extension = g_io_extension_point_get_extension_by_name (point, env);
-
- if (extension == NULL)
- g_warning ("Can't find GSettings backend '%s' given in "
- "GSETTINGS_BACKEND environment variable", env);
- }
-
- if (extension == NULL)
- {
- extensions = g_io_extension_point_get_extensions (point);
-
- if (extensions == NULL)
- g_error ("No GSettingsBackend implementations exist.");
-
- extension = extensions->data;
-
- if (strcmp (g_io_extension_get_name (extension), "memory") == 0)
- g_message ("Using the 'memory' GSettings backend. Your settings "
- "will not be saved or shared with other applications.");
- }
-
- extension_type = g_io_extension_get_type (extension);
- instance = g_object_new (extension_type, NULL);
-
- g_once_init_leave (&backend, (gsize) instance);
- }