title: Does not come out from MainLoop()
body: <p>We were using Python2.3 and wxPython V2.4.2.4 in our project. And it was working fine. Now we are upgrading it to Python2.7 and wxPython2.8.12.1. Our project is compiled fine with new version. But in our project at one stage in the code we destroy the current window and then create &amp; open new window again. And I have noticed that our code after creating new window does not execute. While in the old version it was executing.</p>
  
  <p>In the following code. It is displaying the message "doRead 1" then open the window. But it does not display the message "doRead 2". While in old Python version it was displaying the message "do Read 2" means it was executing the code after that.</p>
  
  <p>I found that, it does not come out from the line "self.MainLoop()" in OnInit(...) function in new project. But it was coming out and thus executing the next line in old project. </p>
  
  <pre><code>-----------------------------------------
  Here is the code:
  #Close existing window.
  self.Destroy()
  print 'doRead 1'
  
  #create new window
  app = App()
  print 'doRead 2'
  app.frame.saveContents()
  ------------------------------------
  
  class App(wx.App):
      """Application class.
      """
      def OnInit(self):
          wx.InitAllImageHandlers()
          resetOptions()
          setOptions()
          self.frame = pdtpFrame()
          self.frame.SetTitle(std.getTitle())
          self.frame.Show()
          self.SetTopWindow(self.frame)
          self.MainLoop()
          return True
  
  
  def main():
      """ Start up the pdtp main window application.
      """
      app = App()
  
  if __name__ == '__main__':
      main()
  </code></pre>