Hi again, I was doing some test to isolate even more. Now I realize why this issue was so difficult to reproduce. This is not only when you use the object handle to cancel the transition instead a transition variable, it also happens with the transition variable, tags, or even calling transition.cancel() without arguments. (You can see this by yourself with the example provided in my last post).
-
If you use a timer.performwithdelay for calling the new scene, the problem is gone. (Even with 0 ms).
-
If you use a timer.performwithdelay for canceling the transition, the problem is also gone. (Even with 0 ms).
-
If you cancel the transition before calling the new scene, the problem is also gone.
This problem seems to happen in very certain moments, but, in some of our games, we have a game loop, controlling, among other things, objects, transitions, etc. This loop must be running continuously in the game, and when we call an overlay scene, it triggers this error very often. The enterFrame event duplicates, it starts to insert two event listeners in the new objects, and, everything starts to duplicate in an exponential way until crashing the game.
Please, take a look at the example provided. We really need some feedback with this.
Thank you for your time, Rob!