[librsvg] handle: remove all_nodes array



commit ad76056ad2da1255c669cb2286aa6279d9bb786c
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jul 29 10:52:43 2018 +0200

    handle: remove all_nodes array
    
    As far as I can see this array of extra refs is not needed.

 librsvg/rsvg-base.c    | 9 ---------
 librsvg/rsvg-handle.c  | 2 --
 librsvg/rsvg-load.c    | 3 ---
 librsvg/rsvg-private.h | 8 ++------
 4 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/librsvg/rsvg-base.c b/librsvg/rsvg-base.c
index 8e953063..56286fa1 100644
--- a/librsvg/rsvg-base.c
+++ b/librsvg/rsvg-base.c
@@ -82,15 +82,6 @@ double rsvg_internal_dpi_x = RSVG_DEFAULT_DPI_X;
 G_GNUC_INTERNAL
 double rsvg_internal_dpi_y = RSVG_DEFAULT_DPI_Y;
 
-void
-rsvg_add_node_to_handle (RsvgHandle *handle, RsvgNode *node)
-{
-    g_assert (handle != NULL);
-    g_assert (node != NULL);
-
-    g_ptr_array_add (handle->priv->all_nodes, rsvg_node_ref (node));
-}
-
 /**
  * rsvg_error_quark:
  *
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index c19208a9..62f89197 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -151,7 +151,6 @@ rsvg_handle_init (RsvgHandle * self)
 
     self->priv->flags = RSVG_HANDLE_FLAGS_NONE;
     self->priv->hstate = RSVG_HANDLE_STATE_START;
-    self->priv->all_nodes = g_ptr_array_new_with_free_func ((GDestroyNotify) rsvg_node_unref);
     self->priv->defs = rsvg_defs_new (self);
     self->priv->dpi_x = rsvg_internal_dpi_x;
     self->priv->dpi_y = rsvg_internal_dpi_y;
@@ -185,7 +184,6 @@ rsvg_handle_dispose (GObject *instance)
         self->priv->user_data_destroy = NULL;
     }
 
-    g_clear_pointer (&self->priv->all_nodes, g_ptr_array_unref);
     g_clear_pointer (&self->priv->defs, rsvg_defs_free);
     g_clear_pointer (&self->priv->css_props, g_hash_table_destroy);
     g_clear_pointer (&self->priv->treebase, rsvg_node_unref);
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index 1388505a..7390de11 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -316,8 +316,6 @@ standard_element_start (RsvgLoad *load, const char *name, RsvgPropertyBag * atts
 
     push_element_name (load, name);
 
-    rsvg_add_node_to_handle (load->handle, newnode);
-
     if (load->currentnode) {
         rsvg_node_add_child (load->currentnode, newnode);
         load->currentnode = rsvg_node_unref (load->currentnode);
@@ -715,7 +713,6 @@ characters_impl (RsvgLoad *load, const char *ch, gssize len)
 
     if (!node) {
         node = rsvg_node_chars_new (load->currentnode);
-        rsvg_add_node_to_handle (load->handle, node);
         rsvg_node_add_child (load->currentnode, node);
     }
 
diff --git a/librsvg/rsvg-private.h b/librsvg/rsvg-private.h
index 4e7b6df7..9a835bbd 100644
--- a/librsvg/rsvg-private.h
+++ b/librsvg/rsvg-private.h
@@ -144,13 +144,12 @@ struct RsvgHandlePrivate {
     gpointer user_data;
     GDestroyNotify user_data_destroy;
 
-    GPtrArray *all_nodes;
-
-    RsvgDefs *defs; /* lookup table for nodes that have an id="foo" attribute */
     /* this is the root level of the displayable tree, essentially what the
        file is converted into at the end */
     RsvgNode *treebase;
 
+    RsvgDefs *defs; /* lookup table for nodes that have an id="foo" attribute */
+
     GHashTable *css_props;
 
     GCancellable *cancellable;
@@ -395,9 +394,6 @@ void rsvg_return_if_fail_warning (const char *pretty_function,
 G_GNUC_INTERNAL
 RsvgNode *rsvg_load_destroy (RsvgLoad *load) G_GNUC_WARN_UNUSED_RESULT;
 
-G_GNUC_INTERNAL
-void rsvg_add_node_to_handle (RsvgHandle *handle, RsvgNode *node);
-
 G_GNUC_INTERNAL
 char *rsvg_handle_resolve_uri (RsvgHandle *handle,
                                const char *uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]