When should I use clone_weak()
?
#9567
Unanswered
ngdangtu-vn
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Weak clones are used you want to maintain a list of fonts that were loaded previously, regardless of whether they exists now. If you are actually using a font, you have to use strong handle, and you already seem to figure out what happens if you don't. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I think that in this case the engine should at least emit an error that it is trying to use an unloaded asset, instead of failing silently. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My problem starts from here:
If I use weak clone on my font handle, it will be easily killed off without a warning. The result is it only display TextSection at first and not do any re-rendering on the later update schedule. (this problem found by sird0rius)
At first, I thought using weak clone with help me optimize the game a bit in loading resource. But it seems like to be removed early without a probable warning, at least from my observation. So I have been wondering if there is any use cases for weak clone, or the function is broken in my case or my font is bad. I don't know which one.
Hope to find an answer in here :D
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions