[maemo-commits] [maemo-commits] r18985 - in projects/haf/trunk/libmatchbox2: . debian matchbox/core

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jul 27 15:14:38 EEST 2009
Author: kihamala
Date: 2009-07-27 15:14:36 +0300 (Mon, 27 Jul 2009)
New Revision: 18985

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/debian/changelog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c
Log:
memset some destroyed objects to zero



Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-07-27 11:23:11 UTC (rev 18984)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-07-27 12:14:36 UTC (rev 18985)
@@ -1,3 +1,19 @@
+2009-07-27  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	Release 0.2.50
+
+	memset several different MBWMObjects to zero to invalidate them
+	properly when they are destroyed, this to avoid using the freed memory
+	area. Hopefully fixes NB#129979.
+
+	* matchbox/core/mb-wm-client-window.c (mb_wm_client_window_destroy):
+	memset the object to zero before freeing it.
+	* matchbox/core/mb-wm-decor.c (mb_wm_decor_destroy,
+	mb_wm_decor_button_destroy): memset the object to zero before freeing
+	it.
+	* matchbox/core/mb-wm-client.c (mb_wm_client_destroy): memset the
+	object to zero before freeing it.
+
 2009-07-24  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	* matchbox/core/mb-wm-client-window.c (icon_from_net_wm_icon): Put a

Modified: projects/haf/trunk/libmatchbox2/debian/changelog
===================================================================
--- projects/haf/trunk/libmatchbox2/debian/changelog	2009-07-27 11:23:11 UTC (rev 18984)
+++ projects/haf/trunk/libmatchbox2/debian/changelog	2009-07-27 12:14:36 UTC (rev 18985)
@@ -1,10 +1,21 @@
-matchbox-window-manager-2 (0.2.50-1~unreleased) unstable; urgency=low
+matchbox-window-manager-2 (0.2.50-1) unstable; urgency=low
 
   Kimmo:
   * Fixes: NB#129833 - Observed a Hildon-desktop crash.
+  * Fixes: NB#129979 - Hildon-Desktop crash while connecting USB in Mass
+    Storage Mode
 
- -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Wed, 22 Jul 2009 13:05:16 +0300
+  Adam:
+  * Allow for KeyRelease event handlers.
 
+  Gordon:
+  * Resolve half of NB#127320 - desktop panning.
+  * Finally remove the 'Monster Hack'.
+  * For RGBA sapwood - look for MAEMO_IGNORE_ALPHA window property, and only
+    ignore alpha if so.
+
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Mon, 27 Jul 2009 15:07:41 +0300
+
 matchbox-window-manager-2 (0.2.49-1) unstable; urgency=low
 
   Laszlo:

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-07-27 11:23:11 UTC (rev 18984)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-window.c	2009-07-27 12:14:36 UTC (rev 18985)
@@ -89,6 +89,8 @@
       mb_wm_rgba_icon_free ((MBWMRgbaIcon *)l->data);
       l = l->next;
     }
+
+  memset (win, 0, sizeof (*win));
 }
 
 static int

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c	2009-07-27 11:23:11 UTC (rev 18984)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.c	2009-07-27 12:14:36 UTC (rev 18985)
@@ -53,14 +53,11 @@
   if (client->sig_theme_change_id)
     mb_wm_object_signal_disconnect (MB_WM_OBJECT (wm),
 				    client->sig_theme_change_id);
-  client->sig_theme_change_id = 0;
 
   if (client->sig_prop_change_id)
     mb_wm_object_signal_disconnect (MB_WM_OBJECT (client->window),
 				    client->sig_prop_change_id);
 
-  client->sig_prop_change_id = 0;
-
   if (client->ping_cb_id)
     mb_wm_main_context_timeout_handler_remove (wm->main_ctx,
 					       client->ping_cb_id);
@@ -78,19 +75,15 @@
     mb_wm_object_unref (l->data);
 
   if (client->decor)
-    {
-      mb_wm_util_list_free (client->decor);
-      client->decor = NULL;
-    }
+    mb_wm_util_list_free (client->decor);
 
   if (client->transient_for)
     mb_wm_client_remove_transient (client->transient_for, client);
 
   if (client->priv)
-    {
-      free (client->priv);
-      client->priv = NULL;
-    }
+    free (client->priv);
+
+  memset (client, 0, sizeof (*client));
 }
 
 static Bool

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c	2009-07-27 11:23:11 UTC (rev 18984)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-decor.c	2009-07-27 12:14:36 UTC (rev 18985)
@@ -686,24 +686,15 @@
     }
 
   if (decor->buttons)
-    {
-      mb_wm_util_list_free (decor->buttons);
-      decor->buttons = NULL;
-    }
+    mb_wm_util_list_free (decor->buttons);
 
   if (decor->press_cb_id)
-  {
     mb_wm_main_context_x_event_handler_remove (ctx, ButtonPress,
 					       decor->press_cb_id);
-    decor->press_cb_id = 0;
-  }
   
   if (decor->release_cb_id)
-  {
     mb_wm_main_context_x_event_handler_remove (ctx, ButtonRelease,
 					     decor->release_cb_id);
-    decor->release_cb_id = 0;
-  }
 
   if (decor->xwin != None)
     {
@@ -711,6 +702,8 @@
       XDestroyWindow (decor->parent_client->wmref->xdpy, decor->xwin);
       mb_wm_util_untrap_x_errors();
     }
+
+  memset (decor, 0, sizeof (*decor));
 }
 
 void
@@ -1178,22 +1171,14 @@
    */
   mb_wm_main_context_x_event_handler_remove (ctx, ButtonPress,
 					     button->press_cb_id);
-  button->press_cb_id = 0;
 
   if (button->userdata && button->destroy_userdata)
-    {
-      button->destroy_userdata (button, button->userdata);
-      button->userdata = NULL;
-      button->destroy_userdata = NULL;
-    }
+    button->destroy_userdata (button, button->userdata);
 
   if (button->themedata && button->destroy_themedata)
-    {
-      button->destroy_themedata (button, button->themedata);
-      button->themedata = NULL;
-      button->destroy_themedata = NULL;
-    }
+    button->destroy_themedata (button, button->themedata);
 
+  memset (button, 0, sizeof (*button));
 }
 
 static void

More information about the maemo-commits mailing list