[librsvg] Use gobject instance private data
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Use gobject instance private data
- Date: Mon, 7 Nov 2011 19:25:46 +0000 (UTC)
commit 6e10eb864916719ff8bb6f57c290942f3f5ecdf5
Author: Christian Persch <chpe gnome org>
Date: Wed Sep 7 12:23:50 2011 +0200
Use gobject instance private data
rsvg-gobject.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/rsvg-gobject.c b/rsvg-gobject.c
index 43fb5a8..eaea0cd 100644
--- a/rsvg-gobject.c
+++ b/rsvg-gobject.c
@@ -63,7 +63,8 @@ static GObjectClass *rsvg_parent_class = NULL;
static void
instance_init (RsvgHandle * self)
{
- self->priv = g_new0 (RsvgHandlePrivate, 1);
+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RSVG_TYPE_HANDLE, RsvgHandlePrivate);
+
self->priv->defs = rsvg_defs_new ();
self->priv->handler_nest = 0;
self->priv->entities = g_hash_table_new (g_str_hash, g_str_equal);
@@ -150,8 +151,6 @@ instance_dispose (GObject * instance)
}
#endif
- g_free (self->priv);
-
rsvg_parent_class->dispose (instance);
}
@@ -302,6 +301,8 @@ class_init (RsvgHandleClass * klass)
_("SVG file metadata"), NULL,
(GParamFlags) (G_PARAM_READABLE)));
+ g_type_class_add_private (klass, sizeof (RsvgHandlePrivate));
+
rsvg_SAX_handler_struct_init ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]