From bcf20955d32b580195f45bf507a5970003f464cf Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Wed, 8 Sep 2010 23:33:45 +0100 Subject: [PATCH] ClutterX11TexturePixmap: Fix unbalanced error trapping I think this is what commit 2cf140550635 intended to do since it specifically mentioned cleaning up the trap in clutter_x11_texture_pixmap_set_pixmap, but although it moved the untrap to only be done in the case where Pixmap != None it left the position of the trap itself unchanged. This meant the error trapping wouldn't be balanced if pixmap == None since the untrap wouldn't be done. We now only trap and untrap around the XGetGeometry call done when pixmap != None. http://bugzilla.clutter-project.org/show_bug.cgi?id=2303 --- clutter/x11/clutter-x11-texture-pixmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clutter/x11/clutter-x11-texture-pixmap.c b/clutter/x11/clutter-x11-texture-pixmap.c index 4bfd0dabf..2d877e7d6 100644 --- a/clutter/x11/clutter-x11-texture-pixmap.c +++ b/clutter/x11/clutter-x11-texture-pixmap.c @@ -797,8 +797,6 @@ clutter_x11_texture_pixmap_set_pixmap (ClutterX11TexturePixmap *texture, priv = texture->priv; - clutter_x11_trap_x_errors (); - /* Get rid of the existing Cogl texture early because it may try to use the pixmap which we might destroy */ material = clutter_texture_get_cogl_material (CLUTTER_TEXTURE (texture)); @@ -807,6 +805,7 @@ clutter_x11_texture_pixmap_set_pixmap (ClutterX11TexturePixmap *texture, if (pixmap != None) { + clutter_x11_trap_x_errors (); status = XGetGeometry (clutter_x11_get_default_display(), (Drawable)pixmap, &root,