Skip to content

Commit

Permalink
Disable main_thread_id assertion for Android debug build
Browse files Browse the repository at this point in the history
This code block was previously commented out and reactivated without a clear reason in the git history
It causes a runtime panic with debug build for Android
So turn it off for Android at compile time
  • Loading branch information
jeyum2 committed Jun 27, 2024
1 parent 4dc2720 commit adb70d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion godot-ffi/src/binding/single_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ impl BindingStorage {
pub unsafe fn get_binding_unchecked() -> &'static GodotBinding {
let storage = Self::storage();

if cfg!(debug_assertions) {
// CHECK Need to check on more platforms.
// Currently, a runtime panic occurs on Android.
if cfg!(all(debug_assertions, not(target_os = "android"))) {
let main_thread_id = storage.main_thread_id.get().expect(
"Godot engine not available; make sure you are not calling it from unit/doc tests",
);
Expand Down

0 comments on commit adb70d0

Please sign in to comment.