pumpThread is running in the background when any PyQt window is opened because that UI has called initializePumpThread().
So the users are :-
Opening a PyQt window.
Then close that PyQt Gui.
Then close Maya as normal.
7/10 times 1 thread will be left open.
So I've setup a script job that calls killPumpThread on maya exit. This has reduced the number of time's 1 thread is still left open. This happens on both 2009, 2010, 2009x64 and 2010x64, XP and Vista. The UI is nothing but a empty QDialog for testing. But infact, if you remove a PyQt UI from the problem and just put a print in the pumpQt() call. Open maya and manualy start a thread by initializePumpThread() and repeat the above steps (without my script job calling killPumpThread ) then maya might close, and might not. And by that I mean you might have to press the close button 10x before the Maya will close.
# The print call to test pumpThread
def pumpQt():
global app
global gPump
def processor():
app.processEvents()
print "Pump"
while gPump:
time.sleep(0.01)
utils.executeDeferred( processor )
I've solved the problem today in a hacky but reliable way. In the initializePumpThread() I'm using DotNet via clr to determin if a maya process is running with one thread. If so I kill it, cleaning up any rouge bad pumpThreads. Also in the scriptJob I'm using DotNet to get the current process and kill it. The whole thing is evalDeffered but with some heavy testing, it's saving all the prefs for maya correctly, before it kill's Maya for good.
When I'm at work if anyone's interested I'll post the new pumpThread hacks here. I'm wondering if not alot of people have come across this problem? It's very consistant problem here. Either people have'nt noticed it, are not using PyQt in production. If you are using PyQt and could post that you are :) then I'd like to hear from you.
-Dave