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 next 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 ?
Re: Heap leaks with fluidsynth on Ubuntu 12.04 [message #43033 is a reply to message #43002] Thu, 24 April 2014 21:02 Go to previous messageGo to next message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
I am using version 7283-precise-i386-nogtk of TheIDE.
When closing my application a Window appears stating "Heap leaks detected".
If I click into the window then the application window disappears from starter but I have to stop debugging myself.
If I click the close button of the window the debugging is stopped but the application window remains in starter with "Fatal Error" as title. Nothing helps to get rid from this Zombee than log out or reboot. Crying or Very Sad
icon6.gif  Re: Heap leaks with fluidsynth on Ubuntu 12.04 [message #43043 is a reply to message #43002] Sat, 26 April 2014 15:52 Go to previous message
ManfredHerr is currently offline  ManfredHerr
Messages: 67
Registered: February 2013
Location: Germany
Member
With version 7310-precise-i386-nogtk no heap leak anymore.
Previous Topic: Convert C# code to U++?
Next Topic: Changing cursor
Goto Forum:
  


Current Time: Thu Apr 18 09:22:16 CEST 2024

Total time taken to generate the page: 0.01958 seconds