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 2539 - SDL_GL_CreateContext memory leak (x11)
Summary: SDL_GL_CreateContext memory leak (x11)
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-11 23:24 UTC by Tito Latini
Modified: 2017-09-22 14:08 UTC (History)
1 user (show)

See Also:


Attachments
patch for x11opengl memory leak (4.18 KB, patch)
2014-05-11 23:24 UTC, Tito Latini
Details | Diff
corrected patch (4.22 KB, patch)
2014-05-12 09:40 UTC, Tito Latini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tito Latini 2014-05-11 23:24:44 UTC
Created attachment 1645 [details]
patch for x11opengl memory leak

No problem if

        _this->gl_config.major_version < 3 &&
        _this->gl_config.profile_mask == 0 &&
        _this->gl_config.flags == 0

otherwise it is necessary to explicitly free the pointer returned by
glXChooseFBConfig [1].

Unluckily, there isn't a way to retrieve the fbconfig-pointer from a
GLXContext. I've attached a patch with a possible solution.

[1] https://www.opengl.org/sdk/docs/man2/xhtml/glXChooseFBConfig.xml
Comment 1 Tito Latini 2014-05-12 09:40:38 UTC
Created attachment 1647 [details]
corrected patch
Comment 2 Tito Latini 2014-05-12 09:42:07 UTC
sorry, the original patch contains an error (corrected).
Comment 3 dafioram 2017-09-22 14:08:37 UTC
This sounds similar to a memory bug in ResidualVM.

See https://github.com/residualvm/residualvm/issues/1365.