Describe the bug
In the Java bindings, many local objects are allocated and released manually, introducing potential memory leaks if not careful.
It's especially true for strings where we write things like this in different places:
const char* rawStr = env->GetStringUTFChars(str, nullptr);
// do something
env->ReleaseStringUTFChars(str, rawStr);
We should rely on RAII helpers instead.
Expected behavior
We should never allocate/release outside of the RAII helpers.
Related files in java directory.
Additional context
This needs to be merged first: #3333
Describe the bug
In the Java bindings, many local objects are allocated and released manually, introducing potential memory leaks if not careful.
It's especially true for strings where we write things like this in different places:
We should rely on RAII helpers instead.
Expected behavior
We should never allocate/release outside of the RAII helpers.
Related files in
javadirectory.Additional context
This needs to be merged first: #3333