Merge pull request #523 from mwhudson/run_in_bg-fd-leak

fix fd leak in run_in_bg
This commit is contained in:
Dimitri John Ledkov 2019-08-19 11:30:52 +01:00 committed by GitHub
commit 1dfffbda01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

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