Skip to content

Commit

Permalink
fix(asyncio): close child_watcher before the main loop is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
wookayin committed Dec 11, 2023
1 parent c4197f1 commit 38fa004
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pynvim/msgpack_rpc/event_loop/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ def _stop(self) -> None:

@override
def _close(self) -> None:

if self._child_watcher is not None:
self._child_watcher.close()
self._child_watcher = None

def _close_transport(transport):
transport.close()

Expand All @@ -264,10 +269,6 @@ async def wait_until_closed():

self._loop.close()

if self._child_watcher is not None:
self._child_watcher.close()
self._child_watcher = None

@override
def _threadsafe_call(self, fn: Callable[[], Any]) -> None:
self._loop.call_soon_threadsafe(fn)
Expand Down

0 comments on commit 38fa004

Please sign in to comment.