[tor-bugs] #29642 [Core Tor/Tor]: Free Windows library handles when we free_all in a module
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Mar 4 00:53:50 UTC 2019
#29642: Free Windows library handles when we free_all in a module
-------------------------+-------------------------------------------------
Reporter: teor | Owner: (none)
Type: | Status: new
enhancement |
Priority: Low | Milestone: Tor: unspecified
Component: Core | Version:
Tor/Tor | Keywords: tor-windows, memory-management,
Severity: Minor | technical-debt
Actual Points: | Parent ID:
Points: 2 | Reviewer:
Sponsor: |
Sponsor31-can |
-------------------------+-------------------------------------------------
Tor frees most resources on shutdown, using module *_free_all functions.
But we don't free Windows library handles.
Here's what we'd need to do:
* write a generic function for freeing Windows library handles in winlib.c
* call that function to free all the library handles, *after* we've
finished using functions from those libraries
This change would only affect compat_time.c and ntmain.c. They don't
currenly have *_free_all functions.
This is low-priority, because Windows libraries are reference-counted. And
the two libraries that tor uses are needed for the life of the process.
For details, see https://docs.microsoft.com/en-
us/windows/desktop/api/libloaderapi/nf-libloaderapi-freelibrary
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29642>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list