diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-05-28 15:24:15 +0200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2014-06-17 13:45:59 +1200 |
commit | d3566a9370f2ebe18153fc195b1f3ed279868a56 (patch) | |
tree | a60d85ac3bcc2972a87fb7381fd26e69f43b99fe | |
parent | f7fb50be8d2634ab1a1a82b21b97175446c221c5 (diff) | |
download | gtk+-d3566a9370f2ebe18153fc195b1f3ed279868a56.tar.gz |
mir: we must leak the window ref for now
By the time we get the call to ensure_no_surface() the window is already
being disposed and the qdata is gone. Our attempt to free the copy of
the ref owned by Mir by looking it up again from our qdata will fail.
-rw-r--r-- | gdk/mir/gdkmireventsource.c | 2 | ||||
-rw-r--r-- | gdk/mir/gdkmirwindowimpl.c | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c index 5be955dcc1..c1b7febaf0 100644 --- a/gdk/mir/gdkmireventsource.c +++ b/gdk/mir/gdkmireventsource.c @@ -681,6 +681,8 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source) */ if (window != NULL) gdk_mir_event_source_queue_event (source->display, window, &event->event); + else + g_warning ("window was destroyed before event arrived..."); gdk_mir_queued_event_free (event); } diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 5ed96dbfbf..79dbe7353a 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -86,7 +86,9 @@ ensure_surface (GdkWindow *window) if (impl->surface) return; - /* no destroy notify: see below... */ + /* no destroy notify -- we must leak for now + * https://bugs.launchpad.net/mir/+bug/1324100 + */ event_delegate.context = _gdk_mir_event_source_get_window_reference (window); // Should probably calculate this once? @@ -116,13 +118,6 @@ ensure_no_surface (GdkWindow *window) GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); GdkMirWindowReference *window_ref; - /* hack: no destroy notify on the mir surface, so we have to grab it - * from ourselves again... - */ - window_ref = _gdk_mir_event_source_get_window_reference (window); - _gdk_mir_window_reference_unref (window_ref); - _gdk_mir_window_reference_unref (window_ref); - if (impl->cairo_surface) { cairo_surface_finish (impl->cairo_surface); |