Make close() idempotent and fix Unicorn memory leak.

This commit is contained in:
Robert Xiao
2023-05-05 17:17:44 -07:00
parent 66c8965f96
commit 8777bb6ae6
2 changed files with 29 additions and 23 deletions

View File

@@ -388,10 +388,10 @@ JNIEXPORT jboolean JNICALL Java_unicorn_Unicorn_arch_1supported(JNIEnv *env,
/*
* Class: unicorn_Unicorn
* Method: close
* Method: _close
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_unicorn_Unicorn_close(JNIEnv *env, jobject self)
JNIEXPORT void JNICALL Java_unicorn_Unicorn__1close(JNIEnv *env, jobject self)
{
uc_engine *eng = getEngine(env, self);
uc_err err = uc_close(eng);