[maemo-commits] [maemo-commits] r17756 - in projects/haf/trunk/libmatchbox2: . matchbox/comp-mgr

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Mar 20 13:36:31 EET 2009
Author: aendrodi
Date: 2009-03-20 13:36:25 +0200 (Fri, 20 Mar 2009)
New Revision: 17756

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
   projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr.c
Log:
	* matchbox/comp-mgr/mb-wm-comp-mgr.c:
	  mb_wm_comp_mgr_unregister_client():
	    break the connection between the wm-client and cmgr-client
	    on both sides and don't leave dangling pointers around.
	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:
	  mb_wm_comp_mgr_clutter_fetch_texture():
	    added a missing mb_wm_util_trap_x_errors().
	  mb_wm_comp_mgr_clutter_client_destroy():
	    prepare for XDamageDestroy() erring out for whatever reason.
	    fixes an abnormal program termination when incoming event
	    notifications are unmapped.


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-03-20 10:56:37 UTC (rev 17755)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-03-20 11:36:25 UTC (rev 17756)
@@ -1,3 +1,17 @@
+2009-03-20  Adam Endrodi  <adam.endrodi at blumsoft.eu>
+
+	* matchbox/comp-mgr/mb-wm-comp-mgr.c:
+	  mb_wm_comp_mgr_unregister_client():
+	    break the connection between the wm-client and cmgr-client
+	    on both sides and don't leave dangling pointers around.
+	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:
+	  mb_wm_comp_mgr_clutter_fetch_texture():
+	    added a missing mb_wm_util_trap_x_errors().
+	  mb_wm_comp_mgr_clutter_client_destroy():
+	    prepare for XDamageDestroy() erring out for whatever reason.
+	    fixes an abnormal program termination when incoming event
+	    notifications are unmapped.
+
 2009-03-19  Adam Endrodi  <adam.endrodi at blumsoft.eu>
 
 	* matchbox/core/mb-wm-client-window.c (mb_wm_client_window_sync_properties):

Modified: projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-03-20 10:56:37 UTC (rev 17755)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c	2009-03-20 11:36:25 UTC (rev 17756)
@@ -205,6 +205,7 @@
 
   /* this will also cause updating the corresponding pixmap
    * and ensures window<->pixmap binding */
+  mb_wm_util_trap_x_errors();
   clutter_x11_texture_pixmap_set_window (
         CLUTTER_X11_TEXTURE_PIXMAP (cclient->priv->texture),
         xwin, FALSE);
@@ -278,8 +279,16 @@
     clutter_actor_destroy (cclient->priv->actor);
 
   if (cclient->priv->window_damage)
-    XDamageDestroy (wm->xdpy, cclient->priv->window_damage);
+    {
+      int err;
 
+      mb_wm_util_trap_x_errors();
+      XDamageDestroy (wm->xdpy, cclient->priv->window_damage);
+      if ((err = mb_wm_util_untrap_x_errors()) != 0)
+        g_warning("XDamageDestroy(0x%lx) for %p: %d",
+                  cclient->priv->window_damage, c, err);
+    }
+
   free (cclient->priv);
 }
 

Modified: projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr.c	2009-03-20 10:56:37 UTC (rev 17755)
+++ projects/haf/trunk/libmatchbox2/matchbox/comp-mgr/mb-wm-comp-mgr.c	2009-03-20 11:36:25 UTC (rev 17756)
@@ -280,6 +280,10 @@
   if (klass->unregister_client)
     klass->unregister_client (mgr, client);
 
+  /* Break the connection between #MBWindowManagerClient
+   * and #MBWMCompMgrClient back and forth.  If we don't
+   * cm_client may end up with a dangling pointer. */
+  client->cm_client->wm_client = NULL;
   mb_wm_object_unref (MB_WM_OBJECT (client->cm_client));
   client->cm_client = NULL;
 }


More information about the maemo-commits mailing list