Skip to content

Commit

Permalink
macOS: Do not stop cvdisplaylink
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Jul 9, 2024
1 parent 210d680 commit 5cdda76
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions macos/cc/WindowMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
dispatch_async(dispatch_get_main_queue(), ^{
window->fFrameRequested = false;
window->dispatch(jwm::classes::EventFrame::kInstance);
if (!window->fFrameRequested) {
std::lock_guard<std::mutex> lock(window->fDisplayLinkMutex);
if (!window->fFrameRequested && window->fDisplayLinkRunning) {
CVDisplayLinkStop(window->fDisplayLink);
window->fDisplayLinkRunning = false;
}
}
// if (!window->fFrameRequested) {
// std::lock_guard<std::mutex> lock(window->fDisplayLinkMutex);
// if (!window->fFrameRequested && window->fDisplayLinkRunning) {
// CVDisplayLinkStop(window->fDisplayLink);
// window->fDisplayLinkRunning = false;
// }
// }
window->unref();
window->fFrameScheduled = false;
});
Expand Down

0 comments on commit 5cdda76

Please sign in to comment.