Skip to content

Commit 7248aff

Browse files
committed
Avoid double confirmation when closing sketch
Fixes #8413 handleQuit() already checks for confirmation if the sketch has been modified (when invoked directly). When invoked indirectly (via handleClose(), as we are closing the last open Editor instance), checkModified() is redundant.
1 parent 1b0f00e commit 7248aff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/src/processing/app/Base.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,6 @@ public void actionPerformed(ActionEvent actionEvent) {
926926
* @return true if succeeded in closing, false if canceled.
927927
*/
928928
public boolean handleClose(Editor editor) {
929-
// Check if modified
930-
if (!editor.checkModified()) {
931-
return false;
932-
}
933929

934930
if (editors.size() == 1) {
935931
handleQuit();
@@ -939,6 +935,10 @@ public boolean handleClose(Editor editor) {
939935
} else {
940936
// More than one editor window open,
941937
// proceed with closing the current window.
938+
// Check if modified
939+
if (!editor.checkModified()) {
940+
return false;
941+
}
942942
editor.setVisible(false);
943943
editor.dispose();
944944
editors.remove(editor);

0 commit comments

Comments
 (0)