diff --git a/app/src/main/java/org/linphone/LinphoneManager.java b/app/src/main/java/org/linphone/LinphoneManager.java index 1096ca4d4..288ccd21e 100644 --- a/app/src/main/java/org/linphone/LinphoneManager.java +++ b/app/src/main/java/org/linphone/LinphoneManager.java @@ -686,9 +686,8 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou } public void restartCore() { - destroyCore(); - startLibLinphone(mServiceContext, false); - sExited = false; + mCore.stop(); + mCore.start(); } private synchronized void startLibLinphone(Context c, boolean isPush) { @@ -877,7 +876,7 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou mCore.setNetworkReachable(false); } } - mCore = null; + mCore.stop(); } public void enableProximitySensing(boolean enable) { diff --git a/app/src/main/java/org/linphone/LinphoneService.java b/app/src/main/java/org/linphone/LinphoneService.java index 89ea219d7..7d788ce0a 100644 --- a/app/src/main/java/org/linphone/LinphoneService.java +++ b/app/src/main/java/org/linphone/LinphoneService.java @@ -425,13 +425,6 @@ public final class LinphoneService extends Service { sInstance = null; LinphoneManager.destroy(); - // The following are required if we want for the Core's finalize() method to be called - // before the super.onDestroy() call. - // We have to so there are no more ref on the native LinphoneCore object and thus call - // it's uninit() method which will free the AndroidPlatformHelper resources... - // Problem is both the below methods do not guaranty the finalize will be called in time... - // System.gc(); - // System.runFinalization(); // Make sure our notification is gone. mNotificationManager.destroy();