!1565 优化task任务执行时,发送消息的处理逻辑

Merge pull request !1565 from wenlong_12/20240919-18.37
This commit is contained in:
openharmony_ci 2024-09-19 13:35:22 +00:00 committed by Gitee
commit a860c3f43e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -65,6 +65,11 @@ bool HdcTaskBase::SendToAnother(const uint16_t command, uint8_t *bufPtr, const i
return true;
} else {
HdcSessionBase *sessionBase = reinterpret_cast<HdcSessionBase *>(taskInfo->ownerSessionClass);
if (sessionBase->IsSessionDeleted(taskInfo->sessionId)) {
WRITE_LOG(LOG_FATAL, "SendToAnother session is deleted channelId:%u command:%u",
taskInfo->channelId, command);
return false;
}
return sessionBase->Send(taskInfo->sessionId, taskInfo->channelId, command, bufPtr, size) > 0;
}
}