[librsvg/librsvg-2.40] bgo#761175 - Allow masks to (re)use a node being referenced



commit fe5711c8785a4ef3582752e2109e54440102c702
Author: Federico Mena Quintero <federico gnome org>
Date:   Sat Nov 11 04:52:09 2017 -0600

    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

 rsvg-structure.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/rsvg-structure.c b/rsvg-structure.c
index 4ab4473..3c972e5 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


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