SFML community forums

Help => General => Topic started by: Travnick on February 03, 2011, 08:29:44 pm

Title: found some memory leaks
Post by: Travnick on February 03, 2011, 08:29:44 pm
I made a little program. Valgrind found memory leaks in it. It look like SFML memory leaks, but it could be my mistake as well:

program code:
http://wklej.org/id/469701/

Valgrind errors:
Code: [Select]
valgrind --leak-check=full --show-reachable=yes -v --log-file=val.txt ./sfmlTest
http://wklej.org/id/469698/
Title: found some memory leaks
Post by: Laurent on February 03, 2011, 08:51:23 pm
It's ok, they are under control ;)

Thanks anyway for reporting them.
Title: found some memory leaks
Post by: Travnick on February 03, 2011, 09:30:11 pm
Quote from: "Laurent"
It's ok, they are under control ;)


so you mean that they will be fixed? in which version?
Title: found some memory leaks
Post by: Laurent on February 03, 2011, 11:43:57 pm
It's a single leak, and it was produced on purpose. And it's already fixed in SFML 2.
Title: found some memory leaks
Post by: JAssange on February 04, 2011, 12:38:13 pm
Quote from: "Laurent"
It's a single leak, and it was produced on purpose. And it's already fixed in SFML 2.

My curiosity has the best of me with this one, what use does an intentional leak have?
Title: found some memory leaks
Post by: Laurent on February 04, 2011, 12:44:23 pm
Quote
My curiosity has the best of me with this one, what use does an intentional leak have?

Not causing a crash, because the object can only be destroyed at global scope, but then there's no guaratee that everybody likes that (global exit is a mess, nobody knows the order of destruction of global objects) -- sometimes causing random crashes.
Well, I know it's a bit ugly, it was more a quick and dirty fix than a clean solution. The clean fix is in SFML 2.