From d695f1bcf9520412428d03b5e0bb9cfe7a4483ee Mon Sep 17 00:00:00 2001 From: z00838083 Date: Fri, 20 Sep 2024 15:21:02 +0800 Subject: [PATCH] Bugfix: add ref count for shared_ptr Signed-off-by: z00838083 --- .../src/continue/state/dsched_continue_state_machine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/dtbschedmgr/src/continue/state/dsched_continue_state_machine.cpp b/services/dtbschedmgr/src/continue/state/dsched_continue_state_machine.cpp index 4e526263..901f515d 100644 --- a/services/dtbschedmgr/src/continue/state/dsched_continue_state_machine.cpp +++ b/services/dtbschedmgr/src/continue/state/dsched_continue_state_machine.cpp @@ -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; }