Skip to content

Commit

Permalink
Fix intermittent crash during window resizing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quipyowert2 committed Jun 14, 2023
1 parent 4d12c90 commit 1784f25
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libgag/src/EventListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ void EventListener::run()
sizeMoveTimerRunning = false;
}
#endif
events.push_back(event);
{
std::lock_guard<std::recursive_mutex> lock(renderMutex);
events.push_back(event);
}
}
}
{
Expand All @@ -191,6 +194,7 @@ void EventListener::run()
}
int EventListener::poll(SDL_Event* e)
{
std::lock_guard<std::recursive_mutex> lock(EventListener::renderMutex);
if (events.size()) {
*e = events.front();
events.pop_front();
Expand Down

0 comments on commit 1784f25

Please sign in to comment.