In your code you call to NewGlobalRef, but there is no corresponding call to DeleteGlobalRef.
In your code you call to NewGlobalRef, but there is no corresponding call to DeleteGlobalRef.