### FluidSynth version
2.3.5

### Describe the bug
Unity Editor crashes when calling delete_fluid_synth in C# script


### Expected behavior
Don't crash and dispose safely


### Steps to reproduce
1. Create a new Unity project
2. Clone and build FluidSynth from Official Github source and place the library 
into the Plugins folder
3. Clone nFluidSynth from https://github.com/atsushieno/nfluidsynth.git
4. Set up C# scripts to make Unity ready to use nFluidSynth to play MIDI files
5. click on Play button
6. Crash!


### Additional context
Just called Unity Official Tech Support and they gave the following info:


According to the stack trace, it looks like this crash comes from the 
NFluidsynth plugin, delete_fluid_synth method:


```
#0  0x0070afe3245320 in __sigaction
#1  0x0070afe329ffe4 in pthread_mutex_lock
#2  0x0070afc3457c4d in delete_fluid_synth
#3  0x000000408c5e53 in (wrapper managed-to-native) 
NFluidsynth.Native.LibFluidsynth:delete_fluid_synth (intptr)
#4  0x0070af2f6462e8 in mono_get_runtime_build_info
#5  0x0070af2f7e5c66 in mono_runtime_invoke
#6  0x0070af2f7e5bb0 in mono_runtime_invoke
```


I am really sure that every function uses the correct IntPtr to call
_______________________________________________
fluid-dev mailing list
fluid-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fluid-dev

Reply via email to