[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[fluid-dev] Memory problems fixed

From: Paul Millar
Subject: [fluid-dev] Memory problems fixed
Date: Tue, 28 Nov 2006 19:38:51 +0000
User-agent: KMail/1.9.5

Hi all,

I'm still having problems (with CVS HEAD) with memory not being freed.  This 
seems to have been caused by still-active voices maintaining their lock on 
the sfont's refcount (see start of delete_fluid_defsfont() in 

The solution I've attached is to explicitly call fluid_voice_off() before 
trying to delete the sfont(s).  This should be OK, right?  For neatness, I've 
also updated fluid_voice.c so neither fluid_voice_off( NULL)  nor calling 
fluid_voice_off() twice with the same voice crashes fluidsynth.

I found a couple of other minor memory leaks: the string tokenizer usage in 
fluid_settings.c and a leaked FILE pointer in fluid_defsfont.c.  Both should 
be fixed in the patch.

With these changes, I'm now only seeing a leak of around 10kB or so.  This all 
seems to come from libasound and libc, and (from what I can see) isn't  
fluidsynth's fault.

I've tested the code against my simple test-case and it seems to work OK.  
But, I'm new to fluidsynth code; perhaps some more familiar with the 
code-base should review this patch.



Attachment: more-leaks-fixed.diff
Description: Text Data

Attachment: pgpbjpeoAt8SC.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]