Well there are a few approaches.
First, once you narrow down the likely location put in a bunch of print statements and see where it’s crashing.
Next, the crash log should tell you some useful information like UI KIt crashed, ALMixer crashed, what thread. If you see the ALMixer thread crashed you can assume it’s an audio problem.
It should also give you a crash signal, like Bus Error (SIGBUS(, Segment Violation (SIGSEGV), Broken Pipe (SIGPIPE) and usually an address that it happened at.
Bus and segment violations are generally trying to access protected memory. Look at this bit of code:
[/code]
local function fred()
print(“barney”)
end
fred = 10
fred()
[/code]
In this case, we have errantly written over the variable name that holds our function. The last line tries to jump to fred’s location in memory and run the code there. Unfortunately, that address is now 10 instead of 0x28374833 (or whatever real memory location) and 10 isn’t a valid memory location and your system will generate a Bus error.
This would be considered a common cause of these errors. So the next bit of advice is to look at the common causes of these which include:
a timer trying to call a function that is no longer around. This happens a lot with with Director or StoryBoard based apps where you have scene files that you are loading and unloading …
So you have SceneA and SceneA fires off a timer, or a transition that calls a function when it’s done, or things like network.request(), audio.play() any thing that can call another function when it’s finished… The player hits a button that loads SceneB and SceneA is purged from memory. That timer is still set to fire and it tries to execute that call back function which isn’t around any more. SIGSEGV…
You basically have to dig through your code and try to isolate places where you didn’t cancel a timer, etc. before the module gets removed. [import]uid: 19626 topic_id: 28816 reply_id: 116109[/import]