title: How can I get my basic SWT application to exit properly in Mac OS X 10.5.6?
body: <p>I have the following SWT test code:</p>
  
  <pre><code>public static void main(String[] args) {
      shell = new Shell();
      shell.setText(APP_NAME + " " + APP_VERSION);
      shell.addShellListener(new ShellListener() {
          public void shellActivated(ShellEvent event) { }
          public void shellClosed(ShellEvent event) { exit(); }
          public void shellDeactivated(ShellEvent event) { }
          public void shellDeiconified(ShellEvent event) { }
          public void shellIconified(ShellEvent event) { }
      });     
      shell.open();
      display = shell.getDisplay();
      while (!shell.isDisposed()) {
          if (!display.readAndDispatch()) {
              display.sleep();
          }
      }
      display.dispose();
  }
  </code></pre>
  
  <p>My exit() method is as follows:</p>
  
  <pre><code>private void exit() {
      System.exit(0);
  }
  </code></pre>
  
  <p>I try to quit the application by closing the shell ("window") or by pulling down the application menu (labeled "SWT") and selecting "Quit". </p>
  
  <p>When I do this, a SWT stub is left behind in the Dock and the SWT application has not actually exited. I have to manually terminate the SWT application through Eclipse or via Force Quit.</p>
  
  <p>I have tried this with the v3.4 and v3.5 SWT jars, under Eclipse 3.4.1 under Mac OS X 10.5.6 (Intel).</p>
  
  <p>Is there additional work I need to do to be able to quit the application when I close the shell?</p>