[metacity] screen: add error trap in get_window_pixbuf



commit 78bbf4423f72797a05bfaddd4121d70db30de9a3
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Sep 12 16:02:37 2015 +0300

    screen: add error trap in get_window_pixbuf
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754009

 src/core/screen.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/core/screen.c b/src/core/screen.c
index bc950c8..c086cef 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1229,8 +1229,14 @@ get_window_pixbuf (MetaWindow *window,
   if (surface == NULL)
     return NULL;
 
+  meta_error_trap_push (NULL);
+
   pixbuf = meta_ui_get_pixbuf_from_surface (surface);
   cairo_surface_destroy (surface);
+
+  if (meta_error_trap_pop_with_return (NULL, FALSE) != Success)
+    g_clear_object (&pixbuf);
+
   if (pixbuf == NULL) 
     return NULL;
 


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