diff options
author | Alejandro G. Castro <alex@igalia.com> | 2009-08-11 10:41:21 +0200 |
---|---|---|
committer | Alejandro G. Castro <alex@igalia.com> | 2009-08-11 10:41:21 +0200 |
commit | 777a6bf13118bfbb3bacdeee1a80d48387dd6f12 (patch) | |
tree | 8c2b8dab89e5d705c7812d9fb89f73c5e940ced3 /hildon/hildon-pannable-area.c | |
parent | 8893d86bce448508554a8803011d183b252728b7 (diff) |
Fixed memory leak of the event window of the pannable.
* hildon/hildon-pannable-area.c
(hildon_pannable_area_button_press_cb),
(hildon_pannable_area_motion_notify_cb),
(hildon_pannable_area_button_release_cb): Added unrefs to reduce
the spurious ref added in the copy, fixes leak of window.
Fixes: NB#130900 (HildonPannableArea will leak it's event_window
if it's realized without showing and then deleted)
Diffstat (limited to 'hildon/hildon-pannable-area.c')
-rw-r--r-- | hildon/hildon-pannable-area.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hildon/hildon-pannable-area.c b/hildon/hildon-pannable-area.c index 86342e4..33033dc 100644 --- a/hildon/hildon-pannable-area.c +++ b/hildon/hildon-pannable-area.c @@ -1979,6 +1979,8 @@ hildon_pannable_area_button_press_cb (GtkWidget * widget, (gpointer) & priv->child); event = (GdkEventButton *) gdk_event_copy ((GdkEvent *) event); + /* remove the reference we added with the copy */ + g_object_unref (priv->event_window); event->x = x; event->y = y; priv->cx = x; @@ -2638,6 +2640,8 @@ hildon_pannable_area_motion_notify_cb (GtkWidget * widget, if (priv->child) { /* Send motion notify to child */ event = (GdkEventMotion *) gdk_event_copy ((GdkEvent *) event); + /* remove the reference we added with the copy */ + g_object_unref (priv->event_window); event->x = priv->cx + (event->x - priv->ix); event->y = priv->cy + (event->y - priv->iy); event->window = g_object_ref (priv->child); @@ -2779,6 +2783,8 @@ hildon_pannable_area_button_release_cb (GtkWidget * widget, event->x, event->y, &x, &y, GDK_BUTTON_RELEASE_MASK); event = (GdkEventButton *) gdk_event_copy ((GdkEvent *) event); + /* remove the reference we added with the copy */ + g_object_unref (priv->event_window); event->x = x; event->y = y; |