JNIEnv *env;
androidjni_attach_thread(&env);
- (*env)->DeleteGlobalRef(env, this->key);
+ if (android_sdk_version >= ANDROID_JELLY_BEAN)
+ { /* there is a bug in JB that causes a SIGSEGV if the key object is
+ * garbage collected so we intentionally leak the reference to it */
+ DBG1(DBG_LIB, "intentionally leaking private key reference due to "
+ "a bug in the framework");
+ }
+ else
+ {
+ (*env)->DeleteGlobalRef(env, this->key);
+ }
(*env)->DeleteGlobalRef(env, this->signature_class);
androidjni_detach_thread();
this->pubkey->destroy(this->pubkey);