Skip to content

Commit 12e423b

Browse files
committed
Disable main_thread_id assertion for debug build
This code block was previously commented out and reactivated without a clear reason in the git history It causes a runtime panic in debug builds for Android If this assertion is required, please implement logic that also considers Android
1 parent e25e994 commit 12e423b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

godot-ffi/src/binding/single_threaded.rs

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ impl BindingStorage {
9292
pub unsafe fn get_binding_unchecked() -> &'static GodotBinding {
9393
let storage = Self::storage();
9494

95+
/*
9596
if cfg!(debug_assertions) {
9697
let main_thread_id = storage.main_thread_id.get().expect(
9798
"Godot engine not available; make sure you are not calling it from unit/doc tests",
@@ -103,6 +104,7 @@ impl BindingStorage {
103104
"attempted to access binding from different thread than main thread; this is UB - use the \"experimental-threads\" feature."
104105
);
105106
}
107+
*/
106108

107109
// SAFETY: This function can only be called when the binding is initialized and from the main thread, so we know that it's initialized.
108110
unsafe { storage.binding.get_unchecked() }

0 commit comments

Comments
 (0)