Poll if HUD window is already terminated before attempting to

communicate the \n character to tell it to terminate.
This commit is contained in:
Matt Turnbull 2008-12-22 20:17:29 +00:00
parent a6c2152be4
commit a76442f67e

View File

@ -154,8 +154,11 @@ class GuiAutoImport (threading.Thread):
else: # toggled off
self.doAutoImportBool = False # do_import will return this and stop the gobject callback timer
print "Stopping autoimport"
print >>self.pipe_to_hud.stdin, "\n"
#self.pipe_to_hud.communicate('\n') # waits for process to terminate
if self.pipe_to_hud.poll() is not None:
print "HUD already terminated"
else:
#print >>self.pipe_to_hud.stdin, "\n"
self.pipe_to_hud.communicate('\n') # waits for process to terminate
self.pipe_to_hud = None
self.startButton.set_label(u'Start Autoimport')