From 155b770acdb5e32c35fcc8a8c1060010941d0c58 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 12 Aug 2014 08:22:43 -0300 Subject: [PATCH] Avoid crash by ASSERT() I think this ASSERT crashes the program because they aren't called from the main thread, but I'm not quite sure. --- src/allegro/src/keyboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/allegro/src/keyboard.c b/src/allegro/src/keyboard.c index a3eb490c6..e5650afec 100644 --- a/src/allegro/src/keyboard.c +++ b/src/allegro/src/keyboard.c @@ -497,7 +497,10 @@ void _handle_key_release(int scancode) repeat_scan = -1; } - ASSERT(scancode < KEY_MAX); + /* This is quite common if we press the numpad dot/delete. In debug + mode this asserts crashes the whole program. */ + /* ASSERT(scancode < KEY_MAX); */ + if (scancode >= KEY_MAX) { TRACE(PREFIX_I "Scancode out of range %d\n", scancode); return;