Closed lovelypp777 closed 3 years ago
This is not a QnA forum. Use the Google Group clearly referenced in the issue template:
http://groups.google.com/group/jna-users
When you ask, please prepare a self contained reproducer, that shows your problem. The google group should be used because there are other people that are willing to help and not just direct project committers.
My DLL defines a callback function named as mycallback DLL_API typedef void(mycallback)(void ptr, int userData); where ptr is a mallocated buf: ptr = (MyStructure*)malloc(sizeof(MyStructure));
in java, before return from mycallback, it calls Native.free to free the memory: Native.free(Memory.nativeValue(ptr));
when call Native.free,the vm is crashed.
my dll is a x64 which is developed us msvc 2019. java sdk version is jdk-8u301-windows-x64.
the following is the log file(hs_err_pid16904.log) generated: