summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-11 04:52:09 -0600
committerFederico Mena Quintero <federico@gnome.org>2017-12-05 06:58:10 -0600
commitfe5711c8785a4ef3582752e2109e54440102c702 (patch)
tree3285c28264527705ad487f20c5365f7cf3f7b29a
parent90cda486949d92e8ef3185e8e7a581e20f8a5f27 (diff)
downloadlibrsvg-fe5711c8785a4ef3582752e2109e54440102c702.tar.gz
bgo#761175 - Allow masks to (re)use a node being referenced
If a <use> element acquires a node for drawing, then it needs to release the node before calling pop_discrete_layer(). Mask generation occurs in that function, and the mask may in turn reuse the referenced node. If the node is still acquired at that time, the mask will not be able to use it. https://bugzilla.gnome.org/show_bug.cgi?id=761175
-rw-r--r--rsvg-structure.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rsvg-structure.c b/rsvg-structure.c
index 4ab44730..3c972e50 100644
--- a/rsvg-structure.c
+++ b/rsvg-structure.c
@@ -210,6 +210,8 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_state_push (ctx);
rsvg_node_draw (child, ctx, 1);
rsvg_state_pop (ctx);
+
+ rsvg_release_node (ctx, child);
rsvg_pop_discrete_layer (ctx);
} else {
RsvgNodeSymbol *symbol = (RsvgNodeSymbol *) child;
@@ -246,9 +248,9 @@ rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
rsvg_pop_discrete_layer (ctx);
if (symbol->vbox.active)
_rsvg_pop_view_box (ctx);
- }
- rsvg_release_node (ctx, child);
+ rsvg_release_node (ctx, child);
+ }
}
static void