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 4718

Summary: TLS Doesn't Get Freed
Product: SDL Reporter: bugzilla
Component: threadAssignee: Sam Lantinga <slouken>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: bugzilla, gapkalov, sezeroz
Version: 2.0.9Keywords: target-2.0.12
Hardware: All   
OS: Windows (All)   

Description bugzilla 2019-07-11 18:52:51 UTC
In `src\thread\windows\SDL_systls.c` function `SDL_SYS_GetTLSData` an Thread Local Storage (TLS) gets created with `TlsAlloc`, but never gets freed, causing a small memory leak per thread that gets created.

This should be freed with `TlsFree`

How it was discovered, Microsoft Application Verifier noted us that TLS objects were kept in memory.

Best regards,


Skippy.
Comment 1 Ryan C. Gordon 2019-07-30 17:49:35 UTC
(Sorry if you get several emails like this, we're marking a bunch of bugs.)

We're hoping to ship SDL 2.0.11 on a much shorter timeframe than we have historically done releases, so I'm starting to tag bugs we hope to have closed in this release cycle.

Note that this tag means we just intend to scrutinize this bug for the 2.0.11 release: we may fix it, reject it, or even push it back to a later release for now, but this helps give us both a goal and a wishlist for the next release.

If this bug has been quiet for a few months and you have new information (such as, "this is definitely still broken" or "this got fixed at some point"), please feel free to retest and/or add more notes to the bug.

--ryan.
Comment 2 Dmitry Gapkalov 2019-07-31 18:09:26 UTC
Please check patch here:
https://bugzilla.libsdl.org/show_bug.cgi?id=4673
Comment 3 bugzilla 2019-07-31 22:19:56 UTC
Looks good to me
Comment 4 Ryan C. Gordon 2019-09-20 20:47:35 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 5 Ryan C. Gordon 2019-09-20 20:48:42 UTC
We're changing how we do SDL release versions; now releases will be even numbers (2.0.10, 2.0.12, etc), and as soon as we tag a release, we'll move the internal version number to an odd number (2.0.12 ships, we tag the latest in revision control as 2.0.13 immediately, which will become 2.0.14 on release, etc).

As such, I'm moving the bugs tagged with target-2.0.11 to target 2.0.12. Sorry if you get a lot of email from this change!

Thanks,
--ryan.
Comment 6 Sam Lantinga 2019-09-22 17:54:39 UTC
This is a duplicate of bug 4673

*** This bug has been marked as a duplicate of bug 4673 ***