Skip to content

Commit 801c69e

Browse files
authored
Merge pull request livecode#7266 from montegoulding/bugfix-22552
[[ Bug 22552 ]] Fix crash when touching screen during preOpenStack
2 parents a5c2a51 + 458036f commit 801c69e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/notes/bugfix-22552.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash touching screen during preOpenStack on Android

engine/src/mbldc.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ void MCScreenDC::handle_motion(MCEventMotionType p_type, double p_timestamp)
241241

242242
void MCScreenDC::process_touch(MCEventTouchPhase p_phase, void *p_touch_handle, int32_t p_timestamp, int32_t p_x, int32_t p_y)
243243
{
244+
/* It is possible for the engine to receive touch messages between initial startup and
245+
* there being a stack shown, so ignore the touch if there is no current window. */
246+
if (m_current_window == nil)
247+
{
248+
return;
249+
}
250+
244251
MCActiveTouch *t_touch, *t_previous_touch;
245252
t_previous_touch = nil;
246253
for(t_touch = m_active_touches; t_touch != nil; t_previous_touch = t_touch, t_touch = t_touch -> next)

0 commit comments

Comments
 (0)