Skip to content

Commit e1a5be7

Browse files
committed
Cleanup IDE quit()
There were two different routines andling more or less the same operations. Let the IDE call "real" quit when the last Editor windows is being closed.
1 parent b7728be commit e1a5be7

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

app/src/processing/app/Base.java

+2-27
Original file line numberDiff line numberDiff line change
@@ -925,45 +925,20 @@ public void actionPerformed(ActionEvent actionEvent) {
925925
*/
926926
public boolean handleClose(Editor editor) {
927927
// Check if modified
928-
// boolean immediate = editors.size() == 1;
929928
if (!editor.checkModified()) {
930929
return false;
931930
}
932931

933932
if (editors.size() == 1) {
934-
storeScreenDimensions();
935-
storeSketches();
936-
937-
// This will store the sketch count as zero
938-
editors.remove(editor);
939-
try {
940-
Editor.serialMonitor.close();
941-
} catch (Exception e) {
942-
//ignore
943-
}
944-
rebuildRecentSketchesMenuItems();
945-
946-
// Save out the current prefs state
947-
PreferencesData.save();
948933

949-
// Since this wasn't an actual Quit event, call System.exit()
950-
System.exit(0);
934+
handleQuit();
951935

952936
} else {
953937
// More than one editor window open,
954938
// proceed with closing the current window.
955939
editor.setVisible(false);
956940
editor.dispose();
957-
// for (int i = 0; i < editorCount; i++) {
958-
// if (editor == editors[i]) {
959-
// for (int j = i; j < editorCount-1; j++) {
960-
// editors[j] = editors[j+1];
961-
// }
962-
// editorCount--;
963-
// // Set to null so that garbage collection occurs
964-
// editors[editorCount] = null;
965-
// }
966-
// }
941+
967942
editors.remove(editor);
968943
}
969944
return true;

0 commit comments

Comments
 (0)