This commit is contained in:
aozhiwei 2022-12-18 14:26:04 +08:00
parent b83d6e0334
commit 8524855f92

View File

@ -48,6 +48,23 @@ namespace f8
MsgQueue::Instance()->RemoveCallBack(pair.second.next); MsgQueue::Instance()->RemoveCallBack(pair.second.next);
} }
} }
im_msg_mutex_.lock();
if (!im_work_node_) {
im_work_node_ = im_top_node_;
im_top_node_ = nullptr;
im_bot_node_ = nullptr;
}
while (im_work_node_) {
IMMsgNode* pdelnode = im_work_node_;
im_work_node_ = im_work_node_->next;
delete pdelnode;
if (!im_work_node_) {
im_work_node_ = im_top_node_;
im_top_node_ = nullptr;
im_bot_node_ = nullptr;
}
}
im_msg_mutex_.unlock();
} }
void Update() void Update()
@ -142,29 +159,6 @@ namespace f8
void MsgQueue::UnInit() void MsgQueue::UnInit()
{ {
#if 0
im_msg_mutex_->lock();
if (!im_work_node_) {
im_work_node_ = im_top_node_;
im_top_node_ = nullptr;
im_bot_node_ = nullptr;
}
while (im_work_node_) {
IMMsgNode* pdelnode = im_work_node_;
im_work_node_ = im_work_node_->next;
if (pdelnode->msgid == f8::IM_SysMsgQueue) {
a8::XParams* param = (a8::XParams*)pdelnode->params.param1.GetUserData();
delete param;
}
delete pdelnode;
if (!im_work_node_) {
im_work_node_ = im_top_node_;
im_top_node_ = nullptr;
im_bot_node_ = nullptr;
}
}
im_msg_mutex_->unlock();
#endif
} }
void MsgQueue::Update() void MsgQueue::Update()