aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-pixbuf.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-28 01:19:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:51:38 +0800
commitd33983e34ff46696ca48eafb0c37cb8a3ed03c84 (patch)
treea35c2dfbb7c1c87327f573395dfa9ef8234c9cd3 /libgnomecanvas/gnome-canvas-pixbuf.c
parent65b1049d7028a3394961f6d4fe4418e6cdef6053 (diff)
downloadgsoc2013-evolution-d33983e34ff46696ca48eafb0c37cb8a3ed03c84.tar.gz
gsoc2013-evolution-d33983e34ff46696ca48eafb0c37cb8a3ed03c84.tar.zst
gsoc2013-evolution-d33983e34ff46696ca48eafb0c37cb8a3ed03c84.zip
Rename GnomeCanvasItem.destroy() to dispose().
To clarify the semantics: the method may be called multiple times so pointers should be set to NULL after freeing or unreferencing.
Diffstat (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c')
-rw-r--r--libgnomecanvas/gnome-canvas-pixbuf.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c
index 017ee26622..32e83bbe1d 100644
--- a/libgnomecanvas/gnome-canvas-pixbuf.c
+++ b/libgnomecanvas/gnome-canvas-pixbuf.c
@@ -39,7 +39,7 @@ enum {
PROP_PIXBUF
};
-static void gnome_canvas_pixbuf_destroy (GnomeCanvasItem *object);
+static void gnome_canvas_pixbuf_dispose (GnomeCanvasItem *object);
static void gnome_canvas_pixbuf_set_property (GObject *object,
guint param_id,
const GValue *value,
@@ -84,7 +84,7 @@ gnome_canvas_pixbuf_class_init (GnomeCanvasPixbufClass *class)
GDK_TYPE_PIXBUF,
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
- item_class->destroy = gnome_canvas_pixbuf_destroy;
+ item_class->dispose = gnome_canvas_pixbuf_dispose;
item_class->update = gnome_canvas_pixbuf_update;
item_class->draw = gnome_canvas_pixbuf_draw;
item_class->point = gnome_canvas_pixbuf_point;
@@ -104,9 +104,9 @@ gnome_canvas_pixbuf_init (GnomeCanvasPixbuf *gcp)
GnomeCanvasPixbufPrivate);
}
-/* Destroy handler for the pixbuf canvas item */
+/* Dispose handler for the pixbuf canvas item */
static void
-gnome_canvas_pixbuf_destroy (GnomeCanvasItem *object)
+gnome_canvas_pixbuf_dispose (GnomeCanvasItem *object)
{
GnomeCanvasItem *item;
GnomeCanvasPixbuf *gcp;
@@ -119,14 +119,13 @@ gnome_canvas_pixbuf_destroy (GnomeCanvasItem *object)
gcp = GNOME_CANVAS_PIXBUF (object);
priv = gcp->priv;
- /* remember, destroy can be run multiple times! */
- if (priv->pixbuf) {
- g_object_unref (priv->pixbuf);
- priv->pixbuf = NULL;
+ if (priv->pixbuf != NULL) {
+ g_object_unref (priv->pixbuf);
+ priv->pixbuf = NULL;
}
- if (GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->destroy)
- GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->destroy (object);
+ if (GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->dispose)
+ GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->dispose (object);
}