You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason being that after the cleanup function destroys the texture, it is still used by the Sprite shortly after. It's probably not specific to such an use-case, but likely anything that involves a texture being destroyed in a cleanup function.
It would be great for ergonomics if this could be made to work. If it is impossible due to constraints of React, having an utility function that takes a callback which is executed when it is safe to destroy unused resources would go a long way:
cleanup(()=>texture.destroy(true))
* This is stack trace caused by destroying the texture without wrapping it in a setTimeout or similar:
Description
Currently doing something like this does not work*:
The reason being that after the cleanup function destroys the texture, it is still used by the Sprite shortly after. It's probably not specific to such an use-case, but likely anything that involves a texture being destroyed in a cleanup function.
It would be great for ergonomics if this could be made to work. If it is impossible due to constraints of React, having an utility function that takes a callback which is executed when it is safe to destroy unused resources would go a long way:
* This is stack trace caused by destroying the texture without wrapping it in a
setTimeout
or similar:The text was updated successfully, but these errors were encountered: