fix fd leak in run_in_bg

Notices this while debugging something entirely different.
This commit is contained in:
Michael Hudson-Doyle 2019-08-15 10:07:14 +12:00
parent 8b2a59bf2e
commit 9b7eb8883c
1 changed files with 2 additions and 0 deletions

View File

@ -308,6 +308,8 @@ class Application:
fut = self.common['pool'].submit(func)
def in_main_thread(ignored):
self.common['loop'].remove_watch_pipe(pipe)
os.close(pipe)
callback(fut)
pipe = self.common['loop'].watch_pipe(in_main_thread)