Take a reference on the Android display window on set.

This commit is contained in:
Guillaume Beraudo 2011-10-12 14:00:16 +02:00
parent e50de2a2ef
commit c3ce65e802

View file

@ -1191,6 +1191,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv*
,jobject thiz
,jlong lc
,jobject obj) {
jobject oldWindow = (jobject) linphone_core_get_native_video_window_id((LinphoneCore*)lc);
if (oldWindow != NULL) {
env->DeleteGlobalRef(oldWindow);
}
if (obj != NULL) {
obj = env->NewGlobalRef(obj);
}
linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
}