45
45
import processing .app .debug .TargetPackage ;
46
46
import processing .app .debug .TargetPlatform ;
47
47
import processing .app .helpers .*;
48
+ import processing .app .helpers .OSUtils ;
48
49
import processing .app .helpers .filefilters .OnlyDirs ;
49
50
import processing .app .helpers .filefilters .OnlyFilesWithExtension ;
50
51
import processing .app .javax .swing .filechooser .FileNameExtensionFilter ;
@@ -921,7 +922,10 @@ public boolean handleClose(Editor editor) {
921
922
storeSketches ();
922
923
923
924
// This will store the sketch count as zero
925
+ editor .setVisible (false );
926
+ editor .dispose ();
924
927
editors .remove (editor );
928
+
925
929
try {
926
930
Editor .serialMonitor .close ();
927
931
} catch (Exception e ) {
@@ -932,9 +936,10 @@ public boolean handleClose(Editor editor) {
932
936
// Save out the current prefs state
933
937
PreferencesData .save ();
934
938
935
- // Since this wasn't an actual Quit event, call System.exit()
936
- System .exit (0 );
937
-
939
+ // Since this wasn't an actual Quit event, call System.exit() (not on OSX)
940
+ if (!OSUtils .isMacOS ()) {
941
+ System .exit (0 );
942
+ }
938
943
} else {
939
944
// More than one editor window open,
940
945
// proceed with closing the current window.
@@ -976,7 +981,7 @@ public boolean handleQuit() {
976
981
// Save out the current prefs state
977
982
PreferencesData .save ();
978
983
979
- if (!OSUtils .hasMacOSStyleMenus ()) {
984
+ if (!OSUtils .isMacOS ()) {
980
985
// If this was fired from the menu or an AppleEvent (the Finder),
981
986
// then Mac OS X will send the terminate signal itself.
982
987
System .exit (0 );
0 commit comments