[metacity] xrender: do not remove prefs listener if not added



commit 87ac9e2ac11b835aacb3fefe83dfc3a185fe2296
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Mar 12 01:46:22 2017 +0200

    xrender: do not remove prefs listener if not added

 src/compositor/meta-compositor-xrender.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 1a2c4bd..ee88832 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -171,6 +171,8 @@ struct _MetaCompositorXRender
 
   guint           repaint_id;
 
+  gboolean        prefs_listener_added;
+
   guint           show_redraw : 1;
   guint           debug : 1;
 };
@@ -2584,7 +2586,11 @@ meta_compositor_xrender_finalize (GObject *object)
   xdisplay = meta_display_get_xdisplay (display);
   xroot = display->screen->xroot;
 
-  meta_prefs_remove_listener (update_shadows, xrender);
+  if (xrender->prefs_listener_added)
+    {
+      meta_prefs_remove_listener (update_shadows, xrender);
+      xrender->prefs_listener_added = FALSE;
+    }
 
   hide_overlay_window (xrender, xdisplay);
 
@@ -2723,6 +2729,7 @@ meta_compositor_xrender_manage (MetaCompositor  *compositor,
   show_overlay_window (xrender, xdisplay);
 
   meta_prefs_add_listener (update_shadows, xrender);
+  xrender->prefs_listener_added = TRUE;
 
   g_timeout_add (2000, (GSourceFunc) timeout_debug, compositor);
 


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