77 红包 bug修改。
This commit is contained in:
@@ -1473,7 +1473,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRed) {
|
||||
qxRedPacketManager!!.addRedPacket(roomId, messageEvent.text.redpacketInfo)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRedRemove) {
|
||||
qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
|
||||
// qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSongerNum || //房间点歌数量变化
|
||||
msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged
|
||||
) //点歌房下一首歌曲发生变化
|
||||
@@ -3779,59 +3779,59 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
fun cleanupResources() {
|
||||
sDestroied = true
|
||||
Observable.create<Boolean> {
|
||||
try {
|
||||
// 1. 清理 EventBus 注册
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
// 2. 清理 Handler 回调
|
||||
if (roomSwitchHandler != null) {
|
||||
roomSwitchHandler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
||||
// 3. 清理 CountDownTimer
|
||||
releaseCountDownTimer()
|
||||
releaseCountDownTimer1()
|
||||
if (giftCountTimer != null) {
|
||||
giftCountTimer!!.cancel()
|
||||
giftCountTimer = null
|
||||
}
|
||||
try {
|
||||
// 1. 清理 EventBus 注册
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
// 4. 清理 SVGA 资源
|
||||
clearSVGAResources()
|
||||
// 2. 清理 Handler 回调
|
||||
if (roomSwitchHandler != null) {
|
||||
roomSwitchHandler.removeCallbacksAndMessages(null)
|
||||
}
|
||||
|
||||
// 5. 清理自定义悬浮窗
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.destroy()
|
||||
customMusicFloatingView = null
|
||||
}
|
||||
// 3. 清理 CountDownTimer
|
||||
releaseCountDownTimer()
|
||||
releaseCountDownTimer1()
|
||||
if (giftCountTimer != null) {
|
||||
giftCountTimer!!.cancel()
|
||||
giftCountTimer = null
|
||||
}
|
||||
|
||||
// 6. 清理 Agora 资源
|
||||
// 4. 清理 SVGA 资源
|
||||
clearSVGAResources()
|
||||
|
||||
// 5. 清理自定义悬浮窗
|
||||
if (customMusicFloatingView != null) {
|
||||
customMusicFloatingView!!.destroy()
|
||||
customMusicFloatingView = null
|
||||
}
|
||||
|
||||
// 6. 清理 Agora 资源
|
||||
// if (AgoraManager.getInstance() != null) {
|
||||
// AgoraManager.getInstance().cleanup();
|
||||
// }
|
||||
// 清理所有弹框
|
||||
dismissAllDialogs()
|
||||
// 7. 清理 Fragment
|
||||
cleanupFragments()
|
||||
dismissAllDialogs()
|
||||
// 7. 清理 Fragment
|
||||
cleanupFragments()
|
||||
|
||||
// 8. 清理监听器
|
||||
if (mBinding != null) {
|
||||
// 移除所有 OnClickListener 防止内存泄漏
|
||||
clearClickListeners()
|
||||
}
|
||||
ThreadUtils.cancel()
|
||||
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
|
||||
stopkeepLiveService() //停止service
|
||||
CommonAppContext.getInstance().onlineMap.clear()
|
||||
// 8. 清理监听器
|
||||
if (mBinding != null) {
|
||||
// 移除所有 OnClickListener 防止内存泄漏
|
||||
clearClickListeners()
|
||||
}
|
||||
ThreadUtils.cancel()
|
||||
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
|
||||
stopkeepLiveService() //停止service
|
||||
CommonAppContext.getInstance().onlineMap.clear()
|
||||
|
||||
// ImageUtils.clearDiskCache(this)
|
||||
} catch (e: Exception) {
|
||||
LogUtils.e("cleanupResources error: " + e.message)
|
||||
}
|
||||
}.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe()
|
||||
} catch (e: Exception) {
|
||||
LogUtils.e("cleanupResources error: " + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user