Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Heap leaks with fluidsynth on Ubuntu 12.04
Heap leaks with fluidsynth on Ubuntu 12.04 [message #43002] Tue, 22 April 2014 18:13 Go to previous message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
Hi,
I tried to play with the fluidsynth library linked shared to an Upp-app (see below). As soon as a function of fluidsynth is within the code I get "heap leaks detected" on exit. Even if the function is never called.
#include <Core/Core.h>
#include <fluidsynth.h>

using namespace Upp;
const char* sfont = "/usr/share/sounds/sf2/FluidR3_GM.sf2";

static fluid_settings_t* _settings = NULL;
static fluid_synth_t* _synth = NULL;
static fluid_audio_driver_t* _adriver = NULL;

CONSOLE_APP_MAIN
{
//    _settings = new_fluid_settings();

    /* Set the synthesizer settings, if necessary */
//    _synth = new_fluid_synth(_settings);
//	if (fluid_synth_sfload(_synth, sfont,1) < 0)
//		printf("Failed to load the SoundFont\n");
	
//    fluid_settings_setstr(_settings, "audio.driver", "alsa");
//    _adriver = new_fluid_audio_driver(_settings, _synth);

	if (_adriver) delete_fluid_audio_driver(_adriver);
//	if (_synth) delete_fluid_synth( _synth);
//	if (_settings) delete_fluid_settings( _settings);
	exit(0);
}

If I comment the _adriver statement as well then all is fine. Otherwise:
Heap leaks detected:

--memory-breakpoint__ 1 : Memory at 0x7ffff7ff8060, size 0x30 = 48
    +0 0x00007FFFF7FF8060 F0 D4 3F F6 FF 7F 00 00 00 00 00 00 00 00 00 00     ..?............
   +16 0x00007FFFF7FF8070 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00     ................
   +32 0x00007FFFF7FF8080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................
****************** PANIC: Heap leaks detected!

To link all static is not an option. Then a myriad of undefined references appear.

Any other tips ?
 
Read Message
Read Message
Read Message icon6.gif
Previous Topic: Convert C# code to U++?
Next Topic: Changing cursor
Goto Forum:
  


Current Time: Sun Apr 28 19:32:44 CEST 2024

Total time taken to generate the page: 0.02390 seconds