Oops, unref nodes after boxing them and using them.

box_node() returns a raw pointer, and Rust can't track the lifetime of those.
parent 4c4fc481
......@@ -81,7 +81,9 @@ impl NodeTrait for NodeStop {
}
let inherited_state = drawing_ctx::state_new ();
drawing_ctx::state_reconstruct (inherited_state, box_node (node.clone ()));
let boxed_node = box_node (node.clone ());
drawing_ctx::state_reconstruct (inherited_state, boxed_node);
rsvg_node_unref (boxed_node);
let mut color_rgba: cssparser::RGBA;
......
......@@ -346,10 +346,12 @@ impl NodeTrait for NodeUse {
affine.translate (nx, ny);
drawing_ctx::set_current_state_affine (draw_ctx, affine);
let boxed_child = box_node (child.clone ());
drawing_ctx::push_discrete_layer (draw_ctx);
let boxed_child = box_node (child.clone ());
drawing_ctx::draw_node_from_stack (draw_ctx, boxed_child, 1);
rsvg_node_unref (boxed_child);
drawing_ctx::pop_discrete_layer (draw_ctx);
} else {
child.with_impl (|symbol: &NodeSymbol| {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment