From 7248affd7e551c4e619936f747006872cba745b2 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 21 Jan 2019 09:37:12 +0100 Subject: [PATCH] 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. --- app/src/processing/app/Base.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 3c3615381..e487231d5 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -926,10 +926,6 @@ public class Base { * @return true if succeeded in closing, false if canceled. */ public boolean handleClose(Editor editor) { - // Check if modified - if (!editor.checkModified()) { - return false; - } if (editors.size() == 1) { handleQuit(); @@ -939,6 +935,10 @@ public class Base { } else { // More than one editor window open, // proceed with closing the current window. + // Check if modified + if (!editor.checkModified()) { + return false; + } editor.setVisible(false); editor.dispose(); editors.remove(editor);