[librsvg] fix: implement rsvg_node_add_child()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] fix: implement rsvg_node_add_child()
- Date: Fri, 17 Feb 2017 16:39:39 +0000 (UTC)
commit 4853f512a67dbabfe3285d7e5a3cca51949b7003
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Feb 16 23:09:54 2017 -0600
fix: implement rsvg_node_add_child()
rust/src/node.rs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/rust/src/node.rs b/rust/src/node.rs
index 0eb18c0..df03e4c 100644
--- a/rust/src/node.rs
+++ b/rust/src/node.rs
@@ -255,8 +255,13 @@ pub extern fn rsvg_node_foreach_child (raw_node: *const RsvgNode, func: NodeFore
assert! (!raw_node.is_null ());
let node: &RsvgNode = unsafe { & *raw_node };
- for child in node.children.borrow ().iter () {
- let next = unsafe { func (child as *const RsvgNode, data) };
+ for child in &*node.children.borrow () {
+ let boxed_child = box_node (child.clone ());
+
+ let next = unsafe { func (boxed_child, data) };
+
+ unsafe { rsvg_node_unref (boxed_child); }
+
if !next {
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]