After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660745 - GPrivate leaks on Windows
GPrivate leaks on Windows
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gthread
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 660747
 
 
Reported: 2011-10-03 05:20 UTC by Allison Karlitskaya (desrt)
Modified: 2011-10-04 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GPrivate destroy notify testcase (2.10 KB, patch)
2011-10-04 20:03 UTC, Allison Karlitskaya (desrt)
committed Details | Review
win32: stop leaking GPrivate data (4.26 KB, patch)
2011-10-04 20:10 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2011-10-03 05:20:51 UTC
The TLS API on Windows doesn't have an in-built concept of destroy notifies, so we fake it from our thread exit code.  That means that people who use GLib functions (like the slice allocator) from threads that weren't created by GLib are leaking memory.
Comment 1 Allison Karlitskaya (desrt) 2011-10-04 20:03:09 UTC
Created attachment 198245 [details] [review]
Add GPrivate destroy notify testcase

Ensure that GPrivate destroy notifies are properly called.

This test currently fails on win32 (where we are leaking).
Comment 2 Allison Karlitskaya (desrt) 2011-10-04 20:10:31 UTC
Created attachment 198246 [details] [review]
win32: stop leaking GPrivate data

Instead of running the GPrivate destructors from our thread proxy code,
run it from the DllMain handler for the DLL_THREAD_DETACH case.

This should ensure that thread-local data is free at the exit of all
threads -- not just the ones we created for ourselves.
Comment 3 Allison Karlitskaya (desrt) 2011-10-04 20:10:56 UTC
Attachment 198245 [details] pushed as dd09a95 - Add GPrivate destroy notify testcase
Attachment 198246 [details] pushed as f151291 - win32: stop leaking GPrivate data