summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-05-28 15:24:15 +0200
committerRyan Lortie <desrt@desrt.ca>2014-05-28 15:25:34 +0200
commit5af62123b9d10f5649389206a23aa246c9014a38 (patch)
tree90aaa10498bd5470608127a651b8349d0ec505d3
parent4783fc58fc4a81830080d3ae835852abc8425a4a (diff)
downloadgtk+-5af62123b9d10f5649389206a23aa246c9014a38.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.c2
-rw-r--r--gdk/mir/gdkmirwindowimpl.c11
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);