Minor patch

This commit is contained in:
Miroslav Stampar
2016-05-16 15:37:49 +02:00
parent 94091cd0e9
commit fea5cc8579
3 changed files with 8 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import re
import shutil
import sys
import thread
import threading
import time
import traceback
import warnings
@@ -275,6 +276,10 @@ def main():
if conf.get("dumper"):
conf.dumper.flush()
if threading.activeCount() > 1:
logger.debug("short delay for thread finalization")
time.sleep(0.5)
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
if conf.get("threads", 0) > 1 or conf.get("dnsServer"):
os._exit(0)