title: Python Kernel crashes after closing an PyQt4 Gui Application
body: <p>Ok here is my problem:</p>
  
  <p>I want to create a PyQt4 Gui, which can be executed from a python console (tested with IDLE, Spyder Console and IPython Console) and then allows the user to change and view variables. After closing the app the user should be able to do further work with the variables in the console. But by closing the Gui the Kernel crashes and it is not possible to make any new input to the console.</p>
  
  <p>I'm working with Python 2.7 and PyQt4. I am using the following code to start an close the application:</p>
  
  <pre><code>app=QtGui.QApplication(sys.argv)
  MainApp=plottest()
  MainApp.show()
  sys.exit(app.exec_())
  </code></pre>