[mutter] monitor-config-store: Maybe force save configuration on tear down
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-config-store: Maybe force save configuration on tear down
- Date: Wed, 20 Sep 2017 09:39:21 +0000 (UTC)
commit 8b022a5595f7191f2110ebaa793c8143359e14be
Author: Jonas Ådahl <jadahl gmail com>
Date: Mon Sep 11 11:26:03 2017 +0800
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
src/backends/meta-monitor-config-store.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c
index a33ef75..d184b3d 100644
--- a/src/backends/meta-monitor-config-store.c
+++ b/src/backends/meta-monitor-config-store.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]