Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 021f4c2

Browse files
committed
Issue #16481: multiprocessing no longer leaks process handles on Windows.
1 parent e2cf03e commit 021f4c2

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/multiprocessing/forking.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def __init__(self, process_obj):
233233
self.returncode = None
234234
self._handle = hp
235235
self.sentinel = int(hp)
236+
util.Finalize(self, _winapi.CloseHandle, (self.sentinel,))
236237

237238
# send information to child
238239
Popen._tls.process_handle = int(hp)

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ Core and Builtins
8585
Library
8686
-------
8787

88+
- Issue #16481: multiprocessing no longer leaks process handles on Windows.
89+
8890
- Issue #16140: The subprocess module no longer double closes its child
8991
subprocess.PIPE parent file descriptors on child error prior to exec().
9092

0 commit comments

Comments
 (0)