1
0
Fork 0

monitor-config-store: Maybe force save configuration on tear down

If there is a pending config file content replacement in progress on
tear down, cancel it and save it synchronously to avoid any data loss.

https://bugzilla.gnome.org/show_bug.cgi?id=787477
This commit is contained in:
Jonas Ådahl 2017-09-11 11:26:03 +08:00
parent 7a1393ba26
commit 8b022a5595

View file

@ -1434,6 +1434,14 @@ meta_monitor_config_store_dispose (GObject *object)
{
MetaMonitorConfigStore *config_store = META_MONITOR_CONFIG_STORE (object);
if (config_store->save_cancellable)
{
g_cancellable_cancel (config_store->save_cancellable);
g_clear_object (&config_store->save_cancellable);
meta_monitor_config_store_save_sync (config_store);
}
g_clear_pointer (&config_store->configs, g_hash_table_destroy);
g_clear_object (&config_store->user_file);