SFML community forums

Help => General => Topic started by: MthDc on March 21, 2013, 10:51:15 am

Title: Graphics memory leak
Post by: MthDc on March 21, 2013, 10:51:15 am
I detected a memory leak in my application using SFML 2 and went to investigate using the _CrtDumpMemoryLeaks() method in Visual Studio 2010. All of my allocated pointers are properly being deleted(I triple checked this), but the tool reported a leak in sfml-graphics.dll (more precisely when rendering a sprite using the method window.draw(image), where image is an instance of sf::Sprite.

Surely, if this really is an issue of SFML, I can not continue to use this library for serious projects.
Title: Re: Graphics memory leak
Post by: G. on March 21, 2013, 11:13:53 am
People will probably want a complete and minimal example where the supposed leak can be observed. :p
Title: Re: Graphics memory leak
Post by: Roose Bolton of the Dreadfort on March 21, 2013, 11:27:42 am
So you generally think that after the thousands of people who used SFML and hundreds of indie games, you have noticed a memory leak no1 else has, and that it might be SFML and not you.

No, SFML doesn't have a memory leak

Your first problem is using CRT as that can cause false positives, use a proper memory detection program like IBM Rational Purify or VLD http://vld.codeplex.com/
Title: Re: Graphics memory leak
Post by: MthDc on March 21, 2013, 11:28:54 am
Thank you for the links to the other tools. I will check them out and reply soon with my findings.

EDIT: Turned out it was indeed a false positive. Excuse my false accusations.
Title: Re: Graphics memory leak
Post by: Nexus on March 21, 2013, 02:27:30 pm
There have been many non-justified reports of memory leaks in the past. You can search the forum to know more about them.