!16868 修复OnShutdown

Merge pull request !16868 from shegangbin/fix_onshutdown
This commit is contained in:
openharmony_ci 2024-11-08 03:57:56 +00:00 committed by Gitee
commit 5df0053f4d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -54,13 +54,9 @@ void VSyncCallBackListener::OnReadable(int32_t fileDescriptor)
void VSyncCallBackListener::OnShutdown(int32_t fileDescriptor)
{
VLOGI("OnShutdown, fileDescriptor:%{public}d", fileDescriptor);
FdShutDownCallback fdShutDownCallback = nullptr;
{
std::lock_guard<std::mutex> locker(cbMutex_);
fdShutDownCallback = fdShutDownCallback_;
}
if (fdShutDownCallback != nullptr) {
fdShutDownCallback(fileDescriptor);
std::lock_guard<std::mutex> locker(cbMutex_);
if (fdShutDownCallback_ != nullptr) {
fdShutDownCallback_(fileDescriptor);
}
}