Commit b01969a4 authored by Edward Wang's avatar Edward Wang

aout: free dangling global reference

parent df5cadf5
......@@ -243,6 +243,7 @@ void aout_close(void *opaque)
}
(*p_env)->DeleteGlobalRef (p_env, p_sys->buffer);
(*p_env)->DeleteGlobalRef (p_env, p_sys->j_libVlc);
jni_detach_thread ();
free (p_sys);
}
......
......@@ -417,9 +417,9 @@ void Java_org_videolan_libvlc_LibVLC_playMRL(JNIEnv *env, jobject thiz,
/* Create a media player playing environment */
libvlc_media_player_t *mp = libvlc_media_player_new(p_instance);
libvlc_media_player_set_video_title_display(mp, libvlc_position_disable, 0);
jobject myJavaLibVLC = (*env)->NewGlobalRef(env, thiz);
jobject myJavaLibVLC = (*env)->NewGlobalRef(env, thiz); // freed in aout_close
//if AOUT_AUDIOTRACK_JAVA, we use amem
// If AOUT_AUDIOTRACK_JAVA, use amem
jclass cls = (*env)->GetObjectClass(env, thiz);
jmethodID methodId = (*env)->GetMethodID(env, cls, "getAout", "()I");
if ( (*env)->CallIntMethod(env, thiz, methodId) == AOUT_AUDIOTRACK_JAVA )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment