SDL_RenderCopy() memory leak |
myteon
|
I made a .bmp to illustrate the leak I am experiencing.
https://www.dropbox.com/s/9v81raldd0q3mkx/SDLRenderCopy%20Leak.bmp?dl=0 a quick note on the draw(), it contains all call chains to RenderCopy Let me know if the link isn't working |
|||||||||||
|
Swinki3
|
Looking briefly at your code I can see two possible sources of memory leak.
First one is obvious:
This code is lack of release of the first loaded surface - it was not freed, so it results in mem leak. But this doesn't explain huge memory leak you've reported. As you haven't uploaded whole code,I suspect that another leak could be hidden in string rendering routine:
If you use lib similar to SDL_ttf for text rendering, it creates string to texture, allocating another chunk of memory. If this is the case, this texture needs releasing after rendering Last but not least - you do not use of any error checking - it could be another source of errors. I hope I could help. |
|||||||||||||||
|