I was having the same problem but then I would reload the module each time.
CODE
import modulename
reload(modulename)
that prevented the crashing.
here's the main def for instantiating the window:
CODE
win = None
app = None
def Run():
global app
global win
pt.initializePumpThread()
app = QtGui.QApplication(sys.argv)
win = MainWindow()
win.show()
app.connect( app, QtCore.SIGNAL( "lastWindowClosed()" ), app, QtCore.SLOT( "quit()" ) )
Run()