A null check and a locking simplification

This commit is contained in:
Henrik Rydgård committed 2024-01-30 19:15:19 +01:00
1 parent 0576cafdeb
commit fae1f4acd3
2 files changed
+16 -14

No files matched your search

+5 -5
View File
@@ -243,12 +243,12 @@ void DisplayFireVblankStart() {
}
void DisplayFireVblankEnd() {
std::vector<VblankCallback> toCall = [] {
std::lock_guard<std::mutex> guard(listenersLock);
return vblankListeners;
}();
isVblank = 0;
std::vector<VblankCallback> toCall;
{
std::lock_guard<std::mutex> guard(listenersLock);
toCall = vblankListeners;
}
for (VblankCallback cb : toCall) {
cb();