From 8830cb2a766ae605e636661f08cee9ad895c11a1 Mon Sep 17 00:00:00 2001 From: Shylie Date: Mon, 25 Dec 2023 23:33:27 -0500 Subject: [PATCH] Fix integer overflow bug causing infinite event polling --- source/terml_windows.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/terml_windows.cpp b/source/terml_windows.cpp index c2d4874..69fc54e 100644 --- a/source/terml_windows.cpp +++ b/source/terml_windows.cpp @@ -93,6 +93,10 @@ void terml_windows::process_events() } } + if (num_events_read >= num_events_available) + { + return; + } num_events_available -= num_events_read; } }