fix bug leakcanary重复初始化异常
This commit is contained in:
@@ -40,6 +40,7 @@ import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
import com.squareup.leakcanary.RefWatcher;
|
||||
import com.zhidao.boot.persistent.lib.PersistentManager;
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
private static final String TAG = "MogoApplication";
|
||||
|
||||
private long start;
|
||||
|
||||
private volatile static RefWatcher refWatcher;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
initDebugConfig();
|
||||
@@ -281,7 +282,9 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
startService(intent);
|
||||
}
|
||||
|
||||
LeakCanary.install(this);
|
||||
if (refWatcher != null){
|
||||
refWatcher = LeakCanary.install(this);
|
||||
}
|
||||
|
||||
// 初始化 bugly 升级
|
||||
ARouter.getInstance().navigation(UpgradeReportProvider.class);
|
||||
|
||||
Reference in New Issue
Block a user