com.activity.ChatActivity has leaked IntentReceiver io.agora.rtc.internal.AudioRoutingController$HeadsetBroadcastReceiver@32f559 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.shqy.one.activity.ChatActivity has leaked IntentReceiver io.agora.rtc.internal.AudioRoutingController$HeadsetBroadcastReceiver@32f559 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:918)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:719)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1193)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1173)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1167)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:554)
at io.agora.rtc.internal.AudioRoutingController.initialize(AudioRoutingController.java:660)
at io.agora.rtc.internal.RtcEngineImpl.nativeObjectInit(Native Method)
at io.agora.rtc.internal.RtcEngineImpl.<init>(RtcEngineImpl.java:174)
at io.agora.rtc.RtcEngine.create(RtcEngine.java:61)
at com.common.manage.CallManageUtils.initializeEngine(CallManageUtils.java:122)
at com.activity.ChatActivity.initialize(ChatActivity.java:179)
at com.activity.ChatActivity.init(ChatActivity.java:115)
at com.activity.ChatActivity.main(ChatActivity.java:81)
at com.common.activity.BaseActivity.main(BaseActivity.java:54)
at com.common.activity.BaseActivity.onCreate(BaseActivity.java:43)
at android.app.Activity.performCreate(Activity.java:6278)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2396)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2503)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
引起泄露的原因是Context造成的内存泄露,解决方案:使用全局的Context来替代Activity的Context
io.agora.rtc.internal.AudioRoutingController$HeadsetBroadcastReceiver
最新推荐文章于 2024-09-10 09:15:29 发布