title: Python kernel dies for second run of PyQt5 GUI
body: <ul>
  <li>Using Spyder in Python 3.5.2 |Anaconda 4.2.0 (64-bit) Windows package. qt: 5.6.0</li>
  <li>For first run, GUI window opens as expected</li>
  <li>For 2nd run, nothing opens, and receiving <strong>Kernel died, restarting</strong> log message.</li>
  </ul>
  
  <p><strong>gui1.py:</strong></p>
  
  <blockquote>
  <pre><code>import sys from PyQt5.QtWidgets import QApplication, QWidget
  
  app = QApplication(sys.argv)
  
  w = QWidget()
  
  w.resize(250,150) w.show()
  
  #sys.exit(app.exec_()) 
  app.exec_()
  </code></pre>
  </blockquote>
  
  <p><strong>IPhython log:</strong></p>
  
  <pre><code>runfile('F:/work/ws_python/TestProj1/gui1/gui1.py', wdir='F:/work/ws_python/TestProj1/gui1')
  
  runfile('F:/work/ws_python/TestProj1/gui1/gui1.py', wdir='F:/work/ws_python/TestProj1/gui1')
  
  Kernel died, restarting
  
  Kernel died, restarting
  
  Kernel died, restarting
  </code></pre>
  
  <p>Why kernel dies for 2nd run and how to solve it?</p>
  
  <blockquote>
    <p>(Doing the same even using #sys.exit(app.exec_()) as last line.)</p>
  </blockquote>