musikr: implement raii jni classes

This should hopefully mitigate the memory leak problems unless I forget
to transfer over ref ownership to the corresponding class. Analyzed
memory use on load and it looks like the JVM is able to reclaim
everything extracted by the native code, so I should hopefully be fine.
This commit is contained in:
Alexander Capehart
2025-01-18 19:52:05 -07:00
parent 1bf44eba91
commit a0e10ef8dd
18 changed files with 694 additions and 388 deletions
+7 -3
View File
@@ -45,9 +45,13 @@ set_target_properties(
add_library(${CMAKE_PROJECT_NAME} SHARED
# List C/C++ source files with relative paths to this CMakeLists.txt.
taglib_jni.cpp
JVMInputStream.cpp
JVMTagMap.cpp
JVMMetadataBuilder.cpp
JInputStream.cpp
JTagMap.cpp
JMetadataBuilder.cpp
JClassRef.cpp
JObjectRef.cpp
JStringRef.cpp
JByteArrayRef.cpp
)
target_link_options(${CMAKE_PROJECT_NAME}
# @Tolriq found that these flags can reduce the size of the linked