mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
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.
This commit is contained in:
parent
1b0f00ee38
commit
7248affd7e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user