Skip to content

Commit

Permalink
join emitter threads after stop. fixes #252
Browse files Browse the repository at this point in the history
  • Loading branch information
tamland committed Jul 17, 2014
1 parent 3bbcd5b commit 82f5cd8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/watchdog/observers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,16 @@ def _remove_emitter(self, emitter):
del self._emitter_for_watch[emitter.watch]
self._emitters.remove(emitter)
emitter.stop()
emitter.join()

def _get_emitter_for_watch(self, watch):
return self._emitter_for_watch[watch]

def _clear_emitters(self):
for emitter in self._emitters:
emitter.stop()
for emitter in self._emitters:
emitter.join()
self._emitters.clear()
self._emitter_for_watch.clear()

Expand Down

0 comments on commit 82f5cd8

Please sign in to comment.