[gtk+/gtk-3-22] GdkWaylandWindow: Unexport when finalizing
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] GdkWaylandWindow: Unexport when finalizing
- Date: Tue, 9 May 2017 02:43:10 +0000 (UTC)
commit 31c72bd7df562ef9c609010564e2d800a816da13
Author: Jonas Ådahl <jadahl gmail com>
Date: Mon May 8 12:09:00 2017 +0800
GdkWaylandWindow: Unexport when finalizing
The application might not have exported, and it'll be too late for it
at this point anyway, so lets be helpful and not leak it.
https://bugzilla.gnome.org/show_bug.cgi?id=782109
gdk/wayland/gdkwindow-wayland.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index f535e4c..7a33771 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -239,6 +239,8 @@ static void calculate_moved_to_rect_result (GdkWindow *window,
gboolean *flipped_x,
gboolean *flipped_y);
+static gboolean gdk_wayland_window_is_exported (GdkWindow *window);
+
GType _gdk_window_impl_wayland_get_type (void);
G_DEFINE_TYPE (GdkWindowImplWayland, _gdk_window_impl_wayland, GDK_TYPE_WINDOW_IMPL)
@@ -963,12 +965,16 @@ gdk_window_impl_wayland_beep (GdkWindow *window)
static void
gdk_window_impl_wayland_finalize (GObject *object)
{
+ GdkWindow *window = GDK_WINDOW (object);
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object));
impl = GDK_WINDOW_IMPL_WAYLAND (object);
+ if (gdk_wayland_window_is_exported (window))
+ gdk_wayland_window_unexport_handle (window);
+
g_free (impl->title);
g_free (impl->application.application_id);
@@ -4043,6 +4049,14 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = {
* Since: 3.22
*/
+static gboolean
+gdk_wayland_window_is_exported (GdkWindow *window)
+{
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ return !!impl->display_server.xdg_exported;
+}
+
/**
* gdk_wayland_window_export_handle:
* @window: the #GdkWindow to obtain a handle for
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]