JLChen
2021-11-25 5dc625a64cf58d798929f22c3073cd06b837f87a
HDLLinphoneSDKDemoNew/HDLLinphoneSDK/src/main/java/com/hdl/hdllinphonesdk/core/service/HDLLinphoneService.java
@@ -175,12 +175,18 @@
    public void onDestroy() {
        removeAllCallback();
        logout();
        mCore.removeListener(mCoreListener);
        mTimer.cancel();
        mCore.stop();
        // A stopped Core can be started again
        // To ensure resources are freed, we must ensure it will be garbage collected
        mCore = null;
        if(mTimer != null) {
            mTimer.cancel();
        }
        if(mCore != null){
            mCore.removeListener(mCoreListener);
            mCore.stop();
            // A stopped Core can be started again
            // To ensure resources are freed, we must ensure it will be garbage collected
            mCore = null;
        }
        // Don't forget to free the singleton as well
        sInstance = null;