Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in DirectDraw backend #484

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Memory leak in DirectDraw backend #484

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
wontfix This will not be worked on


Copy link

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.13
Reported for operating system, platform: Windows (All), x86

Comments on the original bug report:

On 2009-06-20 14:33:05 +0000, Steven Don wrote:

Created attachment 333
Fix for memory leak

Certain codepaths in the DirectDraw backend for SDL 1.2 SDL_malloc a buffer which is never SDL_free'd. Instead, the pointer is simply overwritten by a pointer to a DirectDraw surface when the surface is locked. That is a memory leak.

The patch attached stores the pointer for later proper release.

I also posted this to the mailing list, and was directed to submit it here.

On 2009-06-30 22:11:39 +0000, Sam Lantinga wrote:

When does surface->pixels get allocated prior to DX5_LockHWSurface()?

On 2009-07-01 11:01:15 +0000, Steven Don wrote:

In SDL_SetVideoMode. The reason I've left it in and don't just SDL_Free it immediately on a lock is on the off-chance that some badly behaved program grabs the pointer immediately after SDL_SetVideoMode and uses it. Freeing it immediately or not allocating it at all would break compatibility with such programs. Personally I think that should be avoided if it can be helped.

On 2009-09-13 16:33:01 +0000, Ryan C. Gordon wrote:

Tagging this bug with "target-1.2.14" so we can try to resolve it for SDL 1.2.14.

Please note that we may choose to resolve it as WONTFIX. This tag is largely so we have a comprehensive wishlist of bugs to examine for 1.2.14 (and so we can close bugs that we'll never fix, rather than have them live forever in Bugzilla).


On 2009-09-26 21:06:21 +0000, Sam Lantinga wrote:

Can you give me a test case that reproduces the memory leak? I'd like to fully understand what's going on before I apply this patch.


On 2009-10-17 11:08:40 +0000, Sam Lantinga wrote:

This is a risky change for SDL 1.2, so I'm going to hold off fixing it for now. If you have a test case, please re-open this bug.


@SDLBugzilla SDLBugzilla added bug wontfix This will not be worked on labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
wontfix This will not be worked on
None yet

No branches or pull requests

1 participant