Bugfix: add ref count for shared_ptr

Signed-off-by: z00838083 <zhuhuixuan@huawei.com>
This commit is contained in:
z00838083 2024-09-20 15:21:02 +08:00
parent 2462e60bf2
commit d695f1bcf9

View File

@ -47,10 +47,12 @@ int32_t DSchedContinueStateMachine::Execute(const AppExecFwk::InnerEvent::Pointe
HILOGE("DSchedContinueStateMachine excute failed, continue or currentState is null");
return INVALID_PARAMETERS_ERR;
}
int32_t ret = currentState_->Execute(dContinue, event);
auto state = currentState_;
int32_t ret = state->Execute(dContinue, event);
if (ret != ERR_OK) {
HILOGE("DSchedContinueStateMachine currentState: %{public}d excute event %{public}d failed, ret %{public}d",
currentState_->GetStateType(), event->GetInnerEventId(), ret);
state->GetStateType(), event->GetInnerEventId(), ret);
}
return ret;
}