This commit is contained in:
aozhiwei 2023-04-04 20:43:21 +08:00
parent 4b69a71f31
commit 2785a947fc

View File

@ -232,11 +232,11 @@ void CondAddBuff::ProcLimitTimeKillTarget()
auto holder = std::make_shared<a8::Holder>
(
[this, context] (const a8::Args& args)
[owner = owner->GetWeakPtrRef(), context] (const a8::Args& args) mutable
{
if (!owner->room->IsDestorying()) {
if (owner.Get() && !owner.Get()->room->IsDestorying()) {
for (auto& pair : context->watch_targets) {
owner->GetTrigger()->RemoveEventHandler(std::get<1>(pair.second));
owner.Get()->GetTrigger()->RemoveEventHandler(std::get<1>(pair.second));
}
}
});