jerome-jouvie / NativeBass

NativeBass 1.1.2 - Java binding for BASS audio system - http://www.un4seen.com/bass.html
http://jerome.jouvie.free.fr/nativebass/index.php
23 stars 7 forks source link

memory leak #2

Open bitleader opened 11 years ago

bitleader commented 11 years ago

Using the BASS_ChannelSetSync() method add a reference to the SYNCPROC argument via the CallbackManager.addCallback(). Trying to remove it by method BASS_ChannelRemoveSync() and/or BASS_StreamFree() has no effect. The only way I can stop leaking the memory is to use the CallbackManager class explicitly.

Example: HSYNC hsync = syncMap.get(intHandle); BASS_ChannelRemoveSync(intHandle, hsync); CallbackManager.addCallback(16, null, hsync.asLong()); CallbackManager.addOwner(0, hsync.asLong());

jerome-jouvie commented 11 years ago

Bug confirmed: BASS_ChannelRemoveSync was missing the two CalbackManager calls you've pointed out.

I'll made a new release soon. In the meantime, you can simply rebuild the NativeBass jar with the fix to avoid calling CallbackManager in your code (16 is a number generated which can change from one release to another).