[librsvg/rustification] Remove _rsvg_node_finalize(); leave only _rsvg_node_free()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustification] Remove _rsvg_node_finalize(); leave only _rsvg_node_free()
- Date: Fri, 2 Dec 2016 22:20:09 +0000 (UTC)
commit 3f685fe1b0e70a9f6def713a6d606b4fa4a2699d
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Dec 2 15:16:04 2016 -0600
Remove _rsvg_node_finalize(); leave only _rsvg_node_free()
And use this consistently in node implementations.
rsvg-shapes.c | 8 ++++----
rsvg-structure.c | 10 ++++------
rsvg-structure.h | 2 --
3 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/rsvg-shapes.c b/rsvg-shapes.c
index 277625a..e7f407c 100644
--- a/rsvg-shapes.c
+++ b/rsvg-shapes.c
@@ -53,8 +53,8 @@ rsvg_node_path_free (RsvgNode * self)
RsvgNodePath *path = (RsvgNodePath *) self;
if (path->builder)
rsvg_path_builder_destroy (path->builder);
- _rsvg_node_finalize (&path->super);
- g_free (path);
+
+ _rsvg_node_free (self);
}
static void
@@ -189,8 +189,8 @@ _rsvg_node_poly_free (RsvgNode * self)
RsvgNodePoly *poly = (RsvgNodePoly *) self;
if (poly->builder)
rsvg_path_builder_destroy (poly->builder);
- _rsvg_node_finalize (&poly->super);
- g_free (poly);
+
+ _rsvg_node_free (self);
}
static RsvgNode *
diff --git a/rsvg-structure.c b/rsvg-structure.c
index a0287d5..0152202 100644
--- a/rsvg-structure.c
+++ b/rsvg-structure.c
@@ -114,7 +114,7 @@ _rsvg_node_init (RsvgNode * self,
}
void
-_rsvg_node_finalize (RsvgNode * self)
+_rsvg_node_free (RsvgNode * self)
{
if (self->state != NULL) {
rsvg_state_free (self->state);
@@ -124,12 +124,10 @@ _rsvg_node_finalize (RsvgNode * self)
g_ptr_array_free (self->children, TRUE);
self->children = NULL;
}
-}
-void
-_rsvg_node_free (RsvgNode * self)
-{
- _rsvg_node_finalize (self);
+ self->parent = NULL;
+ self->type = RSVG_NODE_TYPE_INVALID;
+
g_free (self);
}
diff --git a/rsvg-structure.h b/rsvg-structure.h
index 6059305..cd75176 100644
--- a/rsvg-structure.h
+++ b/rsvg-structure.h
@@ -85,8 +85,6 @@ void rsvg_node_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate
G_GNUC_INTERNAL
void _rsvg_node_draw_children (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate);
G_GNUC_INTERNAL
-void _rsvg_node_finalize (RsvgNode * self);
-G_GNUC_INTERNAL
void _rsvg_node_free (RsvgNode * self);
G_GNUC_INTERNAL
void _rsvg_node_init (RsvgNode * self, RsvgNodeType type);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]