Fix for leak when window destroyed

svn path=/trunk/; revision=17014
This commit is contained in:
Michael David Emmel
2007-01-02 09:05:54 +00:00
parent 5b352c0a63
commit 52297a75b8
2 changed files with 26 additions and 19 deletions

View File

@ -1,3 +1,7 @@
2007-01-02 Michael Emmel <mike.emmel@gmail.com>
* gdkwindow-directfb.c: fixed leak of dfb resource on destroy
2007-01-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkscrolledwindow.h:

View File

@ -113,7 +113,7 @@ gdk_window_schedule_update (GdkWindow *window)
if (!update_idle)
{
update_idle = gdk_threads_add_idle (GDK_PRIORITY_REDRAW,
update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
gdk_window_update_idle, NULL, NULL);
}
}
@ -606,20 +606,23 @@ _gdk_windowing_window_destroy (GdkWindow *window,
if (window == gdk_directfb_focused_window)
gdk_directfb_change_focus (NULL);
if (impl->drawable.surface) {
GdkDrawableImplDirectFB *dimpl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
if(dimpl->cairo_surface) {
cairo_surface_destroy(dimpl->cairo_surface);
dimpl->cairo_surface= NULL;
}
impl->drawable.surface->Release (impl->drawable.surface);
impl->drawable.surface = NULL;
}
if (!recursing && !foreign_destroy && impl->window ) {
impl->window->SetOpacity (impl->window,0);
impl->window->Close(impl->window);
impl->window->Release(impl->window);
impl->window = NULL;
}
#if 0 /* let the finalizer kill it */
if (!recursing && !foreign_destroy)
{
if (impl->window)
impl->window->Destroy (impl->window);
impl->window = NULL;
}
#endif
}
/* This function is called when the window is really gone.
@ -1263,15 +1266,15 @@ _gdk_directfb_move_resize_child (GdkWindow *window,
if (!private->input_only)
{
if (impl->drawable.surface)
{
GdkDrawableImplDirectFB *dimpl;
dimpl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
impl->drawable.surface->Release (impl->drawable.surface);
impl->drawable.surface = NULL;
cairo_surface_destroy(dimpl->cairo_surface);
dimpl->cairo_surface= NULL;
}
if (impl->drawable.surface) {
GdkDrawableImplDirectFB *dimpl = GDK_DRAWABLE_IMPL_DIRECTFB (private->impl);
if(dimpl->cairo_surface) {
cairo_surface_destroy(dimpl->cairo_surface);
dimpl->cairo_surface= NULL;
}
impl->drawable.surface->Release (impl->drawable.surface);
impl->drawable.surface = NULL;
}
parent_impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (private->parent)->impl);