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



commit ac68631f4c8ac07d7c55fc039ccd2b796f2d8969
Author: Jonas Ådahl <jadahl gmail com>
Date:   Sat Mar 4 15:09:45 2017 +0800

    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

 src/backends/meta-monitor-config-store.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c
index 9b02bc0..5d3f5f4 100644
--- a/src/backends/meta-monitor-config-store.c
+++ b/src/backends/meta-monitor-config-store.c
@@ -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;
       }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]