compositor: Avoid a crash if the top window actor is finalized
authorRui Matos <tiagomatos@gmail.com>
Tue, 17 Oct 2017 15:17:55 +0000 (17:17 +0200)
committerJeremy Bicha <jbicha@debian.org>
Sat, 21 Oct 2017 23:47:22 +0000 (00:47 +0100)
Since we're not holding a reference, the top window actor might be
finalized when we paint resulting in a use after free crash.

https://bugzilla.gnome.org/show_bug.cgi?id=788493

Gbp-Pq: Name 0017-compositor-Avoid-a-crash-if-top-window-finalized.patch

src/compositor/compositor.c

index a75ac12c5612d9e0afda1676c815108d8b88ba15..1d5b9ab20018fc4042457bca3d31199fbfbb43de 100644 (file)
@@ -671,6 +671,9 @@ meta_compositor_remove_window (MetaCompositor *compositor,
   if (compositor->unredirected_window == window)
     set_unredirected_window (compositor, NULL);
 
+  if (compositor->top_window_actor == window_actor)
+    compositor->top_window_actor = NULL;
+
   meta_window_actor_destroy (window_actor);
 }