From 1410df401bd839d85ae6997bd1ddc277848e01c5 Mon Sep 17 00:00:00 2001 From: xufuji456 <839789740@qq.com> Date: Sat, 18 Sep 2021 23:19:34 +0800 Subject: [PATCH] delete local reference after newShortArray --- app/src/main/cpp/audio_player.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/cpp/audio_player.cpp b/app/src/main/cpp/audio_player.cpp index eb0a045..c3e3ff8 100644 --- a/app/src/main/cpp/audio_player.cpp +++ b/app/src/main/cpp/audio_player.cpp @@ -384,4 +384,5 @@ void fft_callback(JNIEnv *jniEnv, jobject thiz, jmethodID fft_method, int16_t * jshortArray dataArray = jniEnv->NewShortArray(samples); jniEnv->SetShortArrayRegion(dataArray, 0, samples, arg); jniEnv->CallVoidMethod(thiz, fft_method, dataArray); + jniEnv->DeleteLocalRef(dataArray); } \ No newline at end of file