Hi all,
I was debugging a memory leak in my application and came across this code in RoboPlatform:
void willTerminate () {
// shutdown the GL and AL systems after our configured delay
new NSTimer(config.timeForTermination, new VoidBlock1<NSTimer>() {
public void invoke (NSTimer timer) {
// shutdown the GL view completely
EAGLContext.setCurrentContext(null);
// stop and release the AL resources (if audio was ever initialized)
if (audio != null) audio.terminate();
}
}, null, false);
// let the app know that we're terminating
dispatchEvent(lifecycle, Lifecycle.EXIT);
}
Perhaps the idea here was to use the NSTimer constructor which takes an additional boolean ("scheduled") ? When scheduled == true, this will end up calling scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: instead, which is just like timerWithTimeInterval.. but also "schedules it on the current run loop in the default mode."
Not 100% sure whether this was the intention but I can confirm that with the current code, the timer does not fire.
Guillermo