hm, well that appears to be referring to a line in Corona's code, not in your code. swell
What I would do at this point is put a bunch of print statements interspersed with the code around where the problem occurs to try to isolate exactly when the crash happens. Like, if you had
1
2
3
| print("1")
corona.command()
print("2") |
Hey jhocking,
I'm actually trying to do that now, but it's quite a long process; this was one of my first projects and is pretty lengthy.
Still, maybe I'll get some answers.
I hope to try and isolate it tonight but given it is now 5:30 AM that may not happen >.<'
Peach
Resolved - kind of.
It works so I'm happy but I'm still not entirely sure where the issue lies.
How I fixed it was actually simple; rather than using director:changeScene within a function I gave it its own function which I called using a timer.
Calling it with a timer works, without the timer fails.
This still makes no sense to me but I'm glad it's working XD
Thanks guys!
Peach :)
Ah, now I'm understanding better. Changing the scene pretty much kills everything that you've added into the group. This could be problematic because you may have running timers, transitions, and functions that get destroyed while they're still in progress.
For future reference, you need to make sure that timers and transitions are assigned a variable that you can access and cancel at will. The reason why your addition of a timer works may be that you've give the function enough time to exit itself completely before the director class destroys it.
oh I just thought of something related to that. I think somewhere between .268 and .484 they changed the behavior for how objects and event listeners are removed. The change was that now child objects are automatically removed along with their parent without needing to be explicitly removed.
That means you probably had a memory leak where you were failing to remove some child object that had a timer on it; now that the object gets removed, the timer has an error.
Or wait I bet it's related to a transition. The transition has an onComplete function to remove the object but now the object gets removed before the transition is complete, causing the error.
*rubs poor head*
It's still incredibly confusing; you said about making sure each timer and transition had a variable I could cancel at will - well, I was doing that.
That part is still identical - everything is the same as in .268 except the 1/10 second timer. (Timers and transitions are still being canceled as they were.)
Anyway - I still don't know exactly what it was but for now, at least, it's resolved so I can sleep shortly XD
I haven't had an issue like this in a long time, so I panicked, lol.
Peach :)