[librsvg: 1/22] pattern: set the weak ref on the result, not the long-lived node



commit f2ca1bb17abb9d12339edc2b0f81273132c5c7da
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Oct 1 10:12:49 2019 -0500

    pattern: set the weak ref on the result, not the long-lived node

 rsvg_internals/src/pattern.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/pattern.rs b/rsvg_internals/src/pattern.rs
index 95fce0a5..48f864ce 100644
--- a/rsvg_internals/src/pattern.rs
+++ b/rsvg_internals/src/pattern.rs
@@ -145,9 +145,9 @@ impl PaintSource for NodePattern {
         node: &RsvgNode,
         draw_ctx: &mut DrawingCtx,
     ) -> Result<Self::Resolved, PaintServerError> {
-        *self.node.borrow_mut() = Some(node.downgrade());
-
         let mut result = node.borrow().get_impl::<NodePattern>().clone();
+        *result.node.borrow_mut() = Some(node.downgrade());
+
         let mut stack = NodeStack::new();
 
         while !result.is_resolved() {


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