title: How to close a wxDialog so it doesn't prevent program from exiting
body: <p>When I close all windows (frames/dialogs) the debugger keeps the program running.  That's the problem.<br>
  I want the program to close when the dialogs are closed.</p>
  
  <p>I want to do both:<br> 
  1.  Run a program with a dialog as a main window and have the program exit when I close that dialog.<br>
  2.  Run a program with a window frame that can pop up 1 or more dialogs and have that program close once all the dialogs are closed. (currently, closing the form does close all the dialogs, but not the app)
  <br>If there was only a frame, it closes just fine.</p>
  
  <p>How can I close a (null parent) dialog box so that it doesn't keep the program running (message loop running) once all windows are closed.  I do not need the dialog box to cause a program exit, just not prevent a program exit.</p>
  
  <p>In the following sample, if the form were a dialog or if a dialog(ok dialog) were created from within the form and then closed, the program keeps running with all windows closed.</p>
  
  <pre><code>class MyApp : public wxApp
  {
      public:
      bool OnInit();
  private:
      void OnAboutClicked(wxCommandEvent &amp;evt);
      MyFrame1 *myF;
  };
  bool MyApp::OnInit()
  {
      if (!wxApp::OnInit())
          return false;
      myF = new MyFrame1(NULL);
      myF-&gt;Show();
      return true;
  }
  </code></pre>
  
  <p>These do not help.</p>
  
  <pre><code>MyDialog1::~MyDialog1()
  {
      //this-&gt;Destroy();
      //delete this;
  }
  </code></pre>