1
0
Fork 0

monitor-config-store: Don't crash when cleaning up after failing to load

The logical monitor config array ownership was transferred to the
config object when it was created, but was not unset when the config
verification failed, causing the clean up path for invalid configs to
try to clean up the same list again.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-03-04 15:09:45 +08:00
parent 8163ca6821
commit ac68631f4c

View file

@ -546,6 +546,8 @@ handle_end_element (GMarkupParseContext *context,
meta_monitors_config_new (parser->current_logical_monitor_configs,
layout_mode);
parser->current_logical_monitor_configs = NULL;
if (!meta_verify_monitors_config (config, error))
{
g_object_unref (config);
@ -555,8 +557,6 @@ handle_end_element (GMarkupParseContext *context,
g_hash_table_replace (parser->config_store->configs,
config->key, config);
parser->current_logical_monitor_configs = NULL;
parser->state = STATE_MONITORS;
return;
}