I fixed an issue with the Env stored in the Jvm not being thread dependent, which could cause memory leak when multithread was used.
On top of that. I removed as many jni::Jvm::current_env() as possible. Opting to pass its reference to the deepest part of the api.
Most calls to that function now are going to be in the overridden Godot methods (like in Script or ScriptInstance).
I couldn't remove the use of it in destructors as they have no parameters.
I fixed an issue with the Env stored in the Jvm not being thread dependent, which could cause memory leak when multithread was used. On top of that. I removed as many
jni::Jvm::current_env()
as possible. Opting to pass its reference to the deepest part of the api. Most calls to that function now are going to be in the overridden Godot methods (like in Script or ScriptInstance). I couldn't remove the use of it in destructors as they have no parameters.