Skip to content

Commit 33d6483

Browse files
committed
client: destroy created context in stop_channels
improves cleanup
1 parent 79c616b commit 33d6483

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

jupyter_client/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ def stop_channels(self) -> None:
334334
if self.control_channel.is_alive():
335335
self.control_channel.stop()
336336

337+
if self._created_context and not self.context.closed:
338+
self.context.destroy()
339+
337340
@property
338341
def channels_running(self) -> bool:
339342
"""Are any of the channels created and running?"""

0 commit comments

Comments
 (0)