Hello. In this year i noticed,what bass call crash of my app when i call bass_samplefree or bass_channelfree. This happens,when audio ducking finish callback was called,i.e when ducking was finished and if ducking ms more then track length (because it exists some cases and i not check this situation). Here is my parts of example on c++.
```
#include "bass.h"
static HSAMPLE h;
static HCHANNEL c;
static void CALLBACK finishCallback(HSYNC handle, DWORD channel, DWORD data, void* user) {
//If we have ducking,if any of this lines will be executed,we will have crash.
BASS_SampleFree(h);
BASS_ChannelFree(c);
}
//init and play content
//some function
static void play() {
if (BASS_Init(-1, 48000, BASS_DEVICE_FREQ, 0, NULL) == 0) {
//error
}
//Подключение плагинов
BASS_PluginLoad("bassmidi.dll", 0);
//Шрифт для миди
HSOUNDFONT newfont = BASS_MIDI_FontInit("chorium.sf2", 0);
if (newfont) {
BASS_MIDI_FONT sf;
sf.font = newfont;
sf.preset = -1; // use all presets
sf.bank = 0; // use default bank(s)
BASS_MIDI_StreamSetFonts(0, &sf, 1); // set default soundfont
//BASS_MIDI_FontFree(font); // free old soundfont
}
h = BASS_SampleLoad(FALSE, "title.ogg", 0, 0, 1, BASS_SAMPLE_FLOAT);
c = BASS_SampleGetChannel(h, BASS_SAMCHAN_STREAM | BASS_SAMCHAN_NEW);
BASS_ChannelSetAttribute(c, BASS_ATTRIB_VOL, 1.0f);
BASS_ChannelSetSync(c, /*BASS_SYNC_ONETIME |*/ BASS_SYNC_MIXTIME | BASS_SYNC_END, 0, finishCallback, 0);
BASS_ChannelSetSync(c, BASS_SYNC_SLIDE, 0, finishCallback, 0);
BASS_ChannelSlideAttribute(c, BASS_ATTRIB_VOL, -1.0f, 7000);
BASS_ChannelPlay(c, false);
}
```
In fact if playing was finished,i not free channel/hsample,but i created it as sample. When firstly playing is finished,and callback call first time,there is no crash,but at the second time,when ducking was finished,we have this crash. It also strange,when if i delete two lines,connected with callbacks and write :
```
ASS_ChannelSetSync(c, BASS_SYNC_MIXTIME | BASS_SYNC_END| BASS_SYNC_SLIDE, 0, finishCallback, 0);
```
There is no callback executed.
I have crash on windows 11 in mfc c++ application with visual studio. You can upload file,which i play,at
https://disk.yandex.com/d/pJCJfnKyaW_pdw. Thank you very much for your help.