From 272676b8967780c8ef922a6c74058e3907e808ca Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 25 Mar 2014 11:59:52 -0400 Subject: [PATCH] surface-actor-wayland: Make sure to clean up on dispose We need to remove our destroy handler if the surface is destroyed before the buffer is, which is the case when we have no destroy effect. --- src/compositor/meta-surface-actor-wayland.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c index 00b766626..bf9441bae 100644 --- a/src/compositor/meta-surface-actor-wayland.c +++ b/src/compositor/meta-surface-actor-wayland.c @@ -136,10 +136,21 @@ meta_surface_actor_wayland_get_window (MetaSurfaceActor *actor) return priv->surface->window; } +static void +meta_surface_actor_wayland_dispose (GObject *object) +{ + MetaSurfaceActorWayland *self = META_SURFACE_ACTOR_WAYLAND (object); + + meta_surface_actor_wayland_set_buffer (self, NULL); + + G_OBJECT_CLASS (meta_surface_actor_wayland_parent_class)->dispose (object); +} + static void meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass) { MetaSurfaceActorClass *surface_actor_class = META_SURFACE_ACTOR_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage; surface_actor_class->pre_paint = meta_surface_actor_wayland_pre_paint; @@ -151,6 +162,8 @@ meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass) surface_actor_class->is_unredirected = meta_surface_actor_wayland_is_unredirected; surface_actor_class->get_window = meta_surface_actor_wayland_get_window; + + object_class->dispose = meta_surface_actor_wayland_dispose; } static void