1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Additional fixes and improvements to JavaClassWrapper

- Fix crashing bug when invoking class constructor with parameters
- Add support for accessing class constants
- Add support for Godot Callable arguments. A Godot Callable can be wrapped by a Java Runnable to allow Java logic to run arbitrary Godot lambdas
- Automatically convert java.lang.CharSequence to Godot String as needed
- Code cleanup
This commit is contained in:
Fredia Huya-Kouadio
2024-11-20 10:10:17 -08:00
parent 6e2cf2aa7b
commit 23cea1b9d2
19 changed files with 526 additions and 126 deletions

View File

@@ -33,7 +33,6 @@
#include "api/java_class_wrapper.h"
#include "api/jni_singleton.h"
#include "jni_utils.h"
#include "string_android.h"
#include "core/config/engine.h"
#include "core/error/error_macros.h"
@@ -136,5 +135,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitS
}
singleton->emit_signalp(StringName(signal_name), args, count);
// Manually invoke the destructor to decrease the reference counts for the variant arguments.
for (int i = 0; i < count; i++) {
variant_params[i].~Variant();
}
}
}