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 issue is that during the removeHandler, an exclusive container adds the gameobject (which uses preUpdate, say a sprite) back to the display list, causing it to be added to the update list; then the destroy finishes, and it is removed from the update list. But the update list does not process additions and deletions immediately; instead, it now has the object in both _pending and _destroy. The end result of this is that it ends up being added to the update list, even if it wasn't originally, when the object is destroyed from within a container.
Example Test Code
I'm using the same code as the previous issue (#5817) for convenience: https://codepen.io/prakol16/pen/YzQXxpg. Note that there, because of the bug, the sprite is never added to the update list while it is alive. However, as soon as it is destroyed, it is added to the update list because of this bug, even though it wasn't on the updateList to begin with. Note that V3 in that issue, which causes the sprite to be added to the update list, is caused by the exact same issue as this bug (adding to both _pending and _destroy). It's just that there, we wanted the sprite to be in the update list, so this bug masks that bug.
The text was updated successfully, but these errors were encountered:
… in the same frame were not correctly removed from the UpdateList. Fix#5803#5817#5818#6052
* `ProcessQueue.isActive` is a new method that tests if the given object is in the active list, or not.
* `ProcessQueue.isPending` is a new method that tests if the given object is in the pending insertion list, or not.
* `ProcessQueue.isDestroying` is a new method that tests if the given object is pending destruction, or not.
* `ProcessQueue.add` will no longer place the item into the pending list if it's already active or pending.
* `ProcessQueue.remove` will check if the item is in the pending list, and simply remove it, rather than destroying it.
Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.
Version
Description
The issue is that during the
removeHandler
, an exclusive container adds the gameobject (which usespreUpdate
, say a sprite) back to the display list, causing it to be added to the update list; then thedestroy
finishes, and it is removed from the update list. But the update list does not process additions and deletions immediately; instead, it now has the object in both_pending
and_destroy
. The end result of this is that it ends up being added to the update list, even if it wasn't originally, when the object is destroyed from within a container.Example Test Code
I'm using the same code as the previous issue (#5817) for convenience: https://codepen.io/prakol16/pen/YzQXxpg. Note that there, because of the bug, the sprite is never added to the update list while it is alive. However, as soon as it is destroyed, it is added to the update list because of this bug, even though it wasn't on the updateList to begin with. Note that V3 in that issue, which causes the sprite to be added to the update list, is caused by the exact same issue as this bug (adding to both
_pending
and_destroy
). It's just that there, we wanted the sprite to be in the update list, so this bug masks that bug.The text was updated successfully, but these errors were encountered: