We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1219

Summary: Memory Leak at SDL_DestroyRenderer in opengl mode
Product: SDL Reporter: Dimitris Zenios <dimitris.zenios>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: Patch to fix leak

Description Dimitris Zenios 2011-06-09 00:39:19 UTC
Created attachment 618 [details]
Patch to fix leak

There is a memory leak of GL_ShaderContext when SDL_DestroyRenderer is called in opengl mode.


==22655== 168 bytes in 1 blocks are definitely lost in loss record 79 of 144
==22655==    at 0x4026D34: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22655==    by 0x4EA0EFC: GL_CreateShaderContext (SDL_shaders_gl.c:274)
==22655==    by 0x4EA0370: GL_CreateRenderer (SDL_render_gl.c:331)
==22655==    by 0x4E9B23F: SDL_CreateRenderer (SDL_render.c:166)
==22655==    by 0x401438: main (main.c:85)

Attached patch fixes this issue
Comment 1 Ryan C. Gordon 2011-07-16 14:59:53 UTC
This is fixed in hg changeset 0d221d6ffac8, thanks!

--ryan.