diff options
author | Attilio Fiandrotti <attilio@src.gnome.org> | 2007-07-12 17:09:02 +0000 |
---|---|---|
committer | Attilio Fiandrotti <attilio@src.gnome.org> | 2007-07-12 17:09:02 +0000 |
commit | 34dfd591dafa2047cb7d894777d3a8656e373229 (patch) | |
tree | 37541d78567c053a409970636ba36b59f8391b21 /gdk | |
parent | 508baa258c47dcf1283f9aaa89494c2522b2e41c (diff) | |
download | gtk+-34dfd591dafa2047cb7d894777d3a8656e373229.tar.gz |
Fixed memory leak at window closing in DirectFB backend, patch provided by Simon Lanzmich
svn path=/trunk/; revision=18459
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/directfb/gdkevents-directfb.c | 19 | ||||
-rw-r--r-- | gdk/directfb/gdkprivate-directfb.h | 3 | ||||
-rw-r--r-- | gdk/directfb/gdkwindow-directfb.c | 4 |
3 files changed, 25 insertions, 1 deletions
diff --git a/gdk/directfb/gdkevents-directfb.c b/gdk/directfb/gdkevents-directfb.c index e3babd4150..2f55b26ca1 100644 --- a/gdk/directfb/gdkevents-directfb.c +++ b/gdk/directfb/gdkevents-directfb.c @@ -315,6 +315,25 @@ gdk_directfb_event_windows_add (GdkWindow *window) impl->window->CreateEventBuffer (impl->window, &EventBuffer); } +#if (DIRECTFB_MAJOR_VERSION >= 1) +void +gdk_directfb_event_windows_remove (GdkWindow *window) +{ + GdkWindowImplDirectFB *impl; + + g_return_if_fail (GDK_IS_WINDOW (window)); + + impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (window)->impl); + + if (!impl->window) + return; + + if (EventBuffer) + impl->window->DetachEventBuffer (impl->window, EventBuffer); +/* FIXME: should we warn if (! EventBuffer) ? */ +} +#endif + GdkWindow * gdk_directfb_child_at (GdkWindow *window, gint *winx, diff --git a/gdk/directfb/gdkprivate-directfb.h b/gdk/directfb/gdkprivate-directfb.h index b4090bb828..b645057f32 100644 --- a/gdk/directfb/gdkprivate-directfb.h +++ b/gdk/directfb/gdkprivate-directfb.h @@ -231,6 +231,9 @@ GdkImage* _gdk_directfb_copy_to_image (GdkDrawable *drawable, gint height); void gdk_directfb_event_windows_add (GdkWindow *window); +#if (DIRECTFB_MAJOR_VERSION >= 1) +void gdk_directfb_event_windows_remove (GdkWindow *window); +#endif GdkGrabStatus gdk_directfb_pointer_grab (GdkWindow *window, gint owner_events, diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c index 7fe3911852..4337cf98ef 100644 --- a/gdk/directfb/gdkwindow-directfb.c +++ b/gdk/directfb/gdkwindow-directfb.c @@ -600,7 +600,9 @@ _gdk_windowing_window_destroy (GdkWindow *window, impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl); _gdk_selection_window_destroyed (window); - +#if (DIRECTFB_MAJOR_VERSION >= 1) + gdk_directfb_event_windows_remove (window); +#endif if (window == _gdk_directfb_pointer_grab_window) gdk_pointer_ungrab (GDK_CURRENT_TIME); if (window == _gdk_directfb_keyboard_grab_window) |