[mutter] settings: Avoid warning when clearing xwayland grab access lists



commit dbd053020a1f0a7982abeb7eedcf493d154f9421
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Jan 22 16:59:09 2018 +0800

    settings: Avoid warning when clearing xwayland grab access lists
    
    On the first run, they are NULL, so don't try to free them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792853

 src/backends/meta-settings.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c
index 8593a17d1..5935c44f2 100644
--- a/src/backends/meta-settings.c
+++ b/src/backends/meta-settings.c
@@ -348,11 +348,13 @@ update_xwayland_grab_access_rules (MetaSettings *settings)
   int i;
 
   /* Free previous patterns and create new arrays */
-  g_ptr_array_free (settings->xwayland_grab_whitelist_patterns, TRUE);
+  g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,
+                   g_ptr_array_unref);
   settings->xwayland_grab_whitelist_patterns =
     g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
 
-  g_ptr_array_free (settings->xwayland_grab_blacklist_patterns, TRUE);
+  g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,
+                   g_ptr_array_unref);
   settings->xwayland_grab_blacklist_patterns =
     g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
 


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