GDK W32: Plug a resource leak

Ensure that surfaces allocated in the impl are destroyed in finalize()

https://bugzilla.gnome.org/show_bug.cgi?id=787089
This commit is contained in:
Руслан Ижбулатов 2017-09-04 14:42:11 +00:00
parent 4198434261
commit 174a36257f

View File

@ -236,6 +236,23 @@ gdk_window_impl_win32_finalize (GObject *object)
g_free (window_impl->decorations);
if (window_impl->cache_surface)
{
cairo_surface_t_note_about_to_dereference (window_impl->cache_surface);
cairo_surface_destroy (window_impl->cache_surface);
window_impl->cache_surface = NULL;
}
if (window_impl->cairo_surface)
{
cairo_surface_t_note_about_to_dereference (window_impl->cairo_surface);
cairo_surface_destroy (window_impl->cairo_surface);
window_impl->cairo_surface = NULL;
}
g_assert (window_impl->transient_owner == NULL);
g_assert (window_impl->transient_children == NULL);
G_OBJECT_CLASS (parent_class)->finalize (object);
}