Rich Rattanni wrote:
> All:
> 
> I have an issue with FusionSound leaking memory in my application.  In
> actuality, the leak is more than likely due to me incorrectly using
> the API so I am posting this question with the hope that someone can
> point out my mistake.
> 
> In my application, I put the following loop...
> .... Initialize FusionSound, declare necessary variables, etc
> fgProvider = NULL;
> while (1)
>     {
>     if (fgProvider) fgProvider->Release(fgProvider);
>     sound->CreateMusicProvider(sound, fg.file, &fgProvider);
>     }
> 
> When executed, I can watch (via top) the available system memory drop
> to 0 then my application segfaults.  I thought all I had to do was
> call Release on the provider, but I must be mistaken.
> Note: the above code was an oversimplification to test that it was the
> provider create/release that caused my application to leak memory over
> the course of 24 hours, I just did this to expedite the results.
> 
> 
> Any help would be greatly appreciated.  Thank you.
> 


Repeating your test with the attached program gives me a constant memory
usage (and no segfault), so your problem must be somewhere else.

For example: are you creating a IFusionSoundStream for each music provider?
If yes, maybe you are not releasing the stream before recreating it.

However, pasting more code from your application would certainly help.


-- 
Regards,
     Claudio Ciccani

[EMAIL PROTECTED]
http://directfb.org
http://sf.net/projects/php-directfb
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <fusionsound.h>

int
main( int argc, char **argv )
{
     IFusionSound              *sound;
     IFusionSoundMusicProvider *provider = NULL;

     FusionSoundInit( &argc, &argv );

     if (argc < 2)
          return 1;

     FusionSoundCreate( &sound );

     while (1) {
          DFBResult ret;
          if (provider) {
               provider->Release( provider );
               provider = NULL;
          }
          ret = sound->CreateMusicProvider( sound, argv[1], &provider );
          if (ret)
               FusionSoundError( "CreateMusicProvider()", ret );
     }

     sound->Release( sound );

     return 0;
}

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to