This commit is contained in:
aozhiwei 2023-11-20 17:04:01 +08:00
parent a9a49026bb
commit 9f5c849671
2 changed files with 11 additions and 1 deletions

View File

@ -89,12 +89,12 @@ Creature::~Creature()
} }
} }
slave_heros_.clear(); slave_heros_.clear();
xtimer_attacher.ClearTimerList();
ClearBuffList(); ClearBuffList();
skill_hash_.clear(); skill_hash_.clear();
ClearPassiveSkill(); ClearPassiveSkill();
trigger_->UnInit(); trigger_->UnInit();
room->grid_service->RemoveCreature(this); room->grid_service->RemoveCreature(this);
xtimer_attacher.ClearTimerList();
} }
bool Creature::HasBuffEffect(int buff_effect_id) bool Creature::HasBuffEffect(int buff_effect_id)

View File

@ -39,6 +39,11 @@ void Trigger::UnInit()
EventHandler, EventHandler,
entry); entry);
list_del_init(&e->entry); list_del_init(&e->entry);
#ifdef MYDEBUG
if (e->holder.use_count() > 1) {
A8_ABORT();
}
#endif
e->holder = nullptr; e->holder = nullptr;
} }
} }
@ -451,6 +456,11 @@ void Trigger::RemoveBuffs(int cond, const std::vector<int>& buffids)
std::weak_ptr<EventHandler> Trigger::AddListener(int event_id, a8::CommonCbProc cb) std::weak_ptr<EventHandler> Trigger::AddListener(int event_id, a8::CommonCbProc cb)
{ {
#ifdef MYDEBUG
if (owner_->room->IsDestorying()) {
A8_ABORT();
}
#endif
auto itr = listeners_hash_.find(event_id); auto itr = listeners_hash_.find(event_id);
if (itr == listeners_hash_.end()) { if (itr == listeners_hash_.end()) {
listeners_hash_[event_id] = list_head(); listeners_hash_[event_id] = list_head();