haxenme/NME — pull request #46 by YAYitsAndrew (2013-01-26 16:18:30+00:00)
Title: JNI fixes to prevent the global ref table from overflowing

Based on a JNI tips article I read (http://developer.android.com/training/articles/perf-jni.html... ) it seems that NewGlobalRef and DeleteGlobalRef were being used incorrectly. NewGlobalRef returns a jclass instance and that is what you pass to DeleteGlobalRef. Without this the DeleteGlobalRef call dumps a warning to the android log and eventually a threshold is hit that will crash the app.