io.agora.rtc.internal.AudioRoutingController$HeadsetBroadcastReceiver

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值