Additionally, don't run callback if the shutdown_event is set

This commit is contained in:
Matt Martz 2014-04-29 19:21:55 -05:00
parent 557e662a6c
commit 44bc5d2bef
1 changed files with 2 additions and 2 deletions

View File

@ -784,7 +784,7 @@ class Speedtest(object):
while thread.isAlive():
thread.join(timeout=0.1)
finished.append(sum(thread.result))
if callback:
if not shutdown_event.isSet() and callback:
callback(thread.i, url_count, end=True)
del thread
@ -835,7 +835,7 @@ class Speedtest(object):
while thread.isAlive():
thread.join(timeout=0.1)
finished.append(thread.result)
if callback:
if not shutdown_event.isSet() and callback:
callback(thread.i, size_count, end=True)
del thread