[clutter/wip/wayland-2: 5/22] wayland-surface: Cleanup properly in _dispose
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/wayland-2: 5/22] wayland-surface: Cleanup properly in _dispose
- Date: Wed, 29 Feb 2012 17:56:59 +0000 (UTC)
commit c05d230397b359a638e619bab5b6d82a86cd451f
Author: Robert Bragg <robert linux intel com>
Date: Mon Jan 9 19:11:43 2012 +0000
wayland-surface: Cleanup properly in _dispose
When disposing a ClutterWaylandSurface we now make sure to unref any
pipeline we created and unref any surface buffer textures we created.
Reviewed-by: Neil Roberts <neil linux intel com>
clutter/wayland/clutter-wayland-surface.c | 30 ++++++++++++++++------------
1 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/clutter/wayland/clutter-wayland-surface.c b/clutter/wayland/clutter-wayland-surface.c
index 667f117..9a163cd 100644
--- a/clutter/wayland/clutter-wayland-surface.c
+++ b/clutter/wayland/clutter-wayland-surface.c
@@ -169,11 +169,28 @@ clutter_wayland_surface_init (ClutterWaylandSurface *self)
}
static void
+free_surface_buffers (ClutterWaylandSurface *self)
+{
+ ClutterWaylandSurfacePrivate *priv = self->priv;
+
+ if (priv->buffer)
+ {
+ cogl_object_unref (priv->buffer);
+ priv->buffer = NULL;
+ free_pipeline (self);
+ }
+}
+
+static void
clutter_wayland_surface_dispose (GObject *object)
{
ClutterWaylandSurface *self = CLUTTER_WAYLAND_SURFACE (object);
ClutterWaylandSurfacePrivate *priv = self->priv;
+ free_pipeline (self);
+ free_surface_buffers (self);
+ priv->surface = NULL;
+
G_OBJECT_CLASS (clutter_wayland_surface_parent_class)->dispose (object);
}
@@ -424,19 +441,6 @@ clutter_wayland_surface_new (struct wl_surface *surface)
return actor;
}
-static void
-free_surface_buffers (ClutterWaylandSurface *self)
-{
- ClutterWaylandSurfacePrivate *priv = self->priv;
-
- if (priv->buffer)
- {
- cogl_object_unref (priv->buffer);
- priv->buffer = NULL;
- free_pipeline (self);
- }
-}
-
/**
* clutter_wayland_surface_attach_buffer:
* @self: A #ClutterWaylandSurface actor
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]