diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index dcd1e3c3f..825215eff 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -566,9 +566,26 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag } } - public void resetLinphoneCore(Context c){ - destroyLinphoneCore(c); - startLibLinphone(c); + public synchronized final void destroyLinphoneCore(Context c) { + sExited = true; + BluetoothManager.getInstance().destroy(); + try { + mTimer.cancel(); + mLc.destroy(); + } + catch (RuntimeException e) { + e.printStackTrace(); + } + finally { + mServiceContext.unregisterReceiver(instance.mKeepAliveReceiver); + mLc = null; + } + } + + public void restartLinphoneCore(Context context){ + destroyLinphoneCore(context); + startLibLinphone(context); + sExited = true; } private synchronized void startLibLinphone(Context c) {