mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Check whether g_settings_schema_source_get_default returned NULL
* src/pgtkfns.c (parse_resource_key): * src/xsettings.c (init_gsettings): Check whether g_settings_schema_source_look up returned NULL (bug#81166). Copyright-paperwork-exempt: yes
This commit is contained in:
parent
ba0b29e808
commit
eac3779a8f
2 changed files with 11 additions and 6 deletions
|
|
@ -1902,6 +1902,8 @@ parse_resource_key (const char *res_key, char *setting_key)
|
|||
|
||||
/* check existence of setting_key */
|
||||
GSettingsSchemaSource *ssrc = g_settings_schema_source_get_default ();
|
||||
if (ssrc == NULL)
|
||||
return NULL; /* No GSettings schemas installed. */
|
||||
GSettingsSchema *scm = g_settings_schema_source_lookup (ssrc, SCHEMA_ID, TRUE);
|
||||
if (!scm)
|
||||
return NULL; /* *.schema.xml is not installed. */
|
||||
|
|
|
|||
|
|
@ -1100,12 +1100,15 @@ init_gsettings (void)
|
|||
|
||||
#if GLIB_CHECK_VERSION (2, 32, 0)
|
||||
{
|
||||
GSettingsSchema *sc = g_settings_schema_source_lookup
|
||||
(g_settings_schema_source_get_default (),
|
||||
GSETTINGS_SCHEMA,
|
||||
true);
|
||||
schema_found = sc != NULL;
|
||||
if (sc) g_settings_schema_unref (sc);
|
||||
GSettingsSchemaSource *source = g_settings_schema_source_get_default
|
||||
();
|
||||
if (source != NULL)
|
||||
{
|
||||
GSettingsSchema *sc = g_settings_schema_source_lookup
|
||||
(source, GSETTINGS_SCHEMA, true);
|
||||
schema_found = sc != NULL;
|
||||
if (sc) g_settings_schema_unref (sc);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue