Need detach() before stopping hi-res timer in Android?


I have defined a HighResolutionTimer-derived class and in the hiResTimerCallback method I stop the timer (under certain conditions).

Apparently I need to add a threadLocalJNIEnvHolder.detach(); call before I call stopTimer(), as otherwise the app will crash under Android.

Is that correct ? Am I doing something wrong ? If not shouldn't that be in the stopTimer method for Android ?


Yes, you're right - thanks for the heads-up! That should be sorted now if you want to try again..

Yep ! It works now.