Skip to content

Commit

Permalink
Another attempt at fixing the shutdown problem
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipi committed Jan 31, 2012
1 parent 9aa62f4 commit fa90b2d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ArmoryQt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,8 @@ def closeEvent(self, event=None):

from twisted.internet import reactor
def endProgram():
if reactor.threadpool is not None:
reactor.threadpool.stop()
app.quit()
try:
sys.exit()
Expand All @@ -1534,6 +1536,8 @@ def endProgram():
if form.abortLoad:
endProgram()

app.connect(form, SIGNAL("lastWindowClosed()"), endProgram)
reactor.addSystemEventTrigger('before', 'shutdown', endProgram)
app.setQuitOnLastWindowClosed(True)
reactor.runReturn()
sys.exit(app.exec_())
Expand Down

0 comments on commit fa90b2d

Please sign in to comment.