This commit is contained in:
aozhiwei 2023-04-05 18:09:36 +08:00
parent b9508abab8
commit e43ad3b5d8

View File

@ -128,6 +128,7 @@ void Room::Init()
void Room::UnInit() void Room::UnInit()
{ {
destorying_ = true; destorying_ = true;
UpdateFrameCall();
incubator_->UnInit(); incubator_->UnInit();
#ifdef DEBUG #ifdef DEBUG
UnInitDebugInfo(); UnInitDebugInfo();
@ -173,6 +174,7 @@ void Room::Update(int delta_time)
long long begin_tick = a8::XGetTickCount(); long long begin_tick = a8::XGetTickCount();
long long end_tick = a8::XGetTickCount(); long long end_tick = a8::XGetTickCount();
#endif #endif
UpdateFrameCall();
if (GetFrameNo() % 2 == 0) { if (GetFrameNo() % 2 == 0) {
UpdateGas(); UpdateGas();
} }
@ -3641,5 +3643,17 @@ void Room::AddFrameCall(FrameCallCb cb, void* context)
void Room::UpdateFrameCall() void Room::UpdateFrameCall()
{ {
if (!work_node_ && top_node_) {
work_node_ = top_node_;
top_node_ = nullptr;
bot_node_ = nullptr;
}
while (work_node_) {
FrameCallNode *pdelnode = work_node_;
work_node_ = pdelnode->next;
if (pdelnode->cb) {
pdelnode->cb(pdelnode->context);
}
delete pdelnode;
}//end while
} }