Skip to content

Commit adb70d0

Browse files
committed
Disable main_thread_id assertion for Android debug build
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
1 parent 4dc2720 commit adb70d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

godot-ffi/src/binding/single_threaded.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ impl BindingStorage {
9292
pub unsafe fn get_binding_unchecked() -> &'static GodotBinding {
9393
let storage = Self::storage();
9494

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

0 commit comments

Comments
 (0)