summaryrefslogtreecommitdiff
path: root/gdk/win32
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2017-09-04 14:42:11 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2017-12-03 03:19:02 +0000
commit174a36257f1118a631a79e53ac295af576203ec0 (patch)
tree9fbf000cb62ad0c0fb68094e79276e8b1ed5a7ce /gdk/win32
parent4198434261483a2d6e0f250a13116a185fd6a635 (diff)
downloadgtk+-174a36257f1118a631a79e53ac295af576203ec0.tar.gz
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
Diffstat (limited to 'gdk/win32')
-rw-r--r--gdk/win32/gdkwindow-win32.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 88c18cc71c..24db897265 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -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);
}