]> sjero.net Git - linphone/commitdiff
Take a reference on android camera preview.
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Mon, 17 Oct 2011 13:09:50 +0000 (15:09 +0200)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Mon, 17 Oct 2011 13:09:50 +0000 (15:09 +0200)
coreapi/linphonecore_jni.cc
mediastreamer2

index d351c77a839b19ee873ad4253dbcb5bc98587dbf..e2dfd5db6f216cb7bee2d868cbd91fe260659524 100644 (file)
@@ -1205,6 +1205,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreviewWindowId(JNIEn
                                                                                                                                                ,jobject thiz
                                                                                                                                                ,jlong lc
                                                                                                                                                ,jobject obj) {
+       jobject oldWindow = (jobject) linphone_core_get_native_preview_window_id((LinphoneCore*)lc);
+       if (oldWindow != NULL) {
+               env->DeleteGlobalRef(oldWindow);
+       }
+       if (obj != NULL) {
+               obj = env->NewGlobalRef(obj);
+       }
        linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj);
 }
 
index 3073a0ed620856744e2718cc94868ed76c5e0a5c..66355f56a793377d02d7a6e30604fbcd23378bd3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3073a0ed620856744e2718cc94868ed76c5e0a5c
+Subproject commit 66355f56a793377d02d7a6e30604fbcd23378bd3