From a76442f67ed99e12f7ac2b64c5a39794b4bc78e1 Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Mon, 22 Dec 2008 20:17:29 +0000 Subject: [PATCH] Poll if HUD window is already terminated before attempting to communicate the \n character to tell it to terminate. --- pyfpdb/GuiAutoImport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 820642e4..ceb3da0d 100644 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -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')