From 2a5ee5dec93b768f6caeb109be2a052ca610e747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Tue, 22 Aug 2017 17:21:41 +0200 Subject: Fix Android remote debug not hitting breakpoints A change in `Main`'s API is needed. Please read the comment in the diff for an explanation. --- platform/android/java_glue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'platform/android/java_glue.cpp') diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index eb139fb471..33781b1385 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -1008,7 +1008,9 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, job ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaClassWrapper", java_class_wrapper)); _initialize_java_modules(); - Main::setup2(); + // Since Godot is initialized on the UI thread, _main_thread_id was set to that thread's id, + // but for Godot purposes, the main thread is the one running the game loop + Main::setup2(Thread::get_caller_id()); ++step; suspend_mutex->unlock(); input_mutex->unlock(); -- cgit v1.2.3