-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak when unloading SF3 #528
Comments
Just an additional comment: Based on fluidsynth 2.0.1 I was only able to create a quick and dirty fix which I sent to "derselbst". The fix is in fluid_defsfont.h, fluid_defsfont.c. The final solution needs to be more verbose because unloading of a sf3 file is different now than unloading of a sf2 file. The information "if(sf3_file)" needs to be preserved from loading to unloading. I recommend not to open the sf3 file again just for this information but save this information accordingly. |
We could unload the individual samples in |
So basically something like this should already be enough:
|
Added a PR that implements this idea. A check with valgrind shows that it actually fixes the memory-leak. |
I tested the fix in our app and it solves the problem. Thank you. |
Thank you @ReinholdH for the report and @mawe42 for the fix! |
FluidSynth version
2.0.4 and trunk
Current behavior
explicit unloading of a sf3 does not release memory
Other information
valgrind says:
The text was updated successfully, but these errors were encountered: