app.as_weak().upgrade().unwrap()
vs app.clone_strong()
#7825
-
I've noticed the first usage everywhere, but why don't we use the second one instead? |
Beta Was this translation helpful? Give feedback.
Answered by
ultimaweapon
Mar 8, 2025
Replies: 1 comment 2 replies
-
The latter will cause the window to contains a strong reference to itself, which prevent its reference count to reach zero. This will cause a resource to leak. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
aurexav
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The latter will cause the window to contains a strong reference to itself, which prevent its reference count to reach zero. This will cause a resource to leak.