Patch to fix a hildon-1 bug



Hi,

Here I send a patch at end of this mail to fix a hildon-1 bug that will
cause program crash as hildon window is destroied in some
cases(Specially the it returns FALSE in the delete-event processing of
that windo). 

Basically, the GtkBorder widget should be freed with gtk_border_free()
rather than using g_free if it's NOT created by g_malloc.

diff --git a/src/hildon-window.c b/src/hildon-window.c
index 1f1fac6..6e67057 100644
--- a/src/hildon-window.c
+++ b/src/hildon-window.c
@@ -380,9 +380,9 @@ hildon_window_finalize
(GObject * o
     
     self = HILDON_WINDOW (obj_self);
 
-    g_free (priv->borders);
-    g_free (priv->toolbar_borders);
-
+    gtk_border_free(priv->borders);
+    gtk_border_free(priv->toolbar_borders);
+       
     if (G_OBJECT_CLASS (parent_class)->finalize)
         G_OBJECT_CLASS (parent_class)->finalize (obj_self);
 
@@ -488,6 +488,8 @@ hildon_window_get_borders
(HildonWindo
 
     g_free (priv->borders);
     g_free (priv->toolbar_borders);
+    priv->borders = NULL;
+    priv->toolbar_borders = NULL;
 
     gtk_widget_style_get (GTK_WIDGET (window),
"borders",&priv->borders,
             "toolbar-borders", &priv->toolbar_borders,



Peter



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