We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2b47644 + cd91bd1 commit bc28d61Copy full SHA for bc28d61
notebook/utils.py
@@ -284,13 +284,15 @@ def check_version(v, check):
284
return True
285
286
287
-# Copy of IPython.utils.process.check_pid:
288
-
289
def _check_pid_win32(pid):
290
import ctypes
291
# OpenProcess returns 0 if no such process (of ours) exists
292
# positive int otherwise
293
- return bool(ctypes.windll.kernel32.OpenProcess(1,0,pid))
+ handle = ctypes.windll.kernel32.OpenProcess(1,0,pid)
+ if handle:
+ # the handle must be closed or the kernel process object won't be freed
294
+ ctypes.windll.kernel32.CloseHandle( handle )
295
+ return bool(handle)
296
297
def _check_pid_posix(pid):
298
"""Copy of IPython.utils.process.check_pid"""
0 commit comments