Skip to content

Commit

Permalink
[Android] Fix crash on some devices
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Jan 15, 2024
1 parent 49bf397 commit 1164584
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ void handle_cmd( android_app *app, int32_t cmd )
case APP_CMD_CONTENT_RECT_CHANGED:
case APP_CMD_WINDOW_RESIZED:
__android_log_print( ANDROID_LOG_INFO, "OgreSamples", "windowMovedOrResized: %d", cmd );
g_appController.mGraphicsSystem->getRenderWindow()->windowMovedOrResized();
// We got crash reports from getting _RESIZED events w/ mGraphicsSystem being a nullptr.
// That's Android for you.
if( g_appController.mGraphicsSystem && g_appController.mGraphicsSystem->getRenderWindow() )
g_appController.mGraphicsSystem->getRenderWindow()->windowMovedOrResized();
break;
default:
__android_log_print( ANDROID_LOG_INFO, "OgreSamples", "event not handled: %d", cmd );
Expand Down

0 comments on commit 1164584

Please sign in to comment.