Re: Freeing a direct NIO buffer with CLinker.freeMemory() causes a double free or corruption
Posted by
gouessej on
Feb 28, 2023; 11:25pm
URL: https://forum.jogamp.org/Freeing-a-direct-NIO-buffer-with-CLinker-freeMemory-causes-a-double-free-or-corruption-tp4042228p4042243.html
I've just found a solution alone but it requires some more invasive changes (Java >= 19):
- create a memory session
- create a native memory segment with this memory session
- create a direct NIO buffer with this memory segment
- use the direct NIO buffer
- close the memory session when I no longer need to use the direct NIO buffer