MCPcopy Index your code
hub / github.com/arduino/Arduino / handleQuit

Method handleQuit

app/src/processing/app/Base.java:981–1012  ·  view source on GitHub ↗

Handler for File → Quit. @return false if canceled, true otherwise.

()

Source from the content-addressed store, hash-verified

979 * @return false if canceled, true otherwise.
980 */
981 public boolean handleQuit() {
982 // If quit is canceled, this will be replaced anyway
983 // by a later handleQuit() that is not canceled.
984 storeScreenDimensions();
985 storeSketches();
986 try {
987 Editor.serialMonitor.close();
988 } catch (Exception e) {
989 // ignore
990 }
991
992 // kill uploader (if still alive)
993 UploaderUtils uploaderInstance = new UploaderUtils();
994 Uploader uploader = uploaderInstance.getUploaderByPreferences(false);
995 if (uploader != null && Uploader.programmerPid != null && Uploader.programmerPid.isAlive()) {
996 // kill the stuck programmer
997 Uploader.programmerPid.destroyForcibly();
998 }
999
1000 if (handleQuitEach()) {
1001 // Save out the current prefs state
1002 PreferencesData.save();
1003
1004 if (!OSUtils.isMacOS()) {
1005 // If this was fired from the menu or an AppleEvent (the Finder),
1006 // then Mac OS X will send the terminate signal itself.
1007 System.exit(0);
1008 }
1009 return true;
1010 }
1011 return false;
1012 }
1013
1014
1015 /**

Callers 3

handleCloseMethod · 0.95
buildFileMenuMethod · 0.80
handleQuitRequestWithMethod · 0.80

Calls 7

storeScreenDimensionsMethod · 0.95
storeSketchesMethod · 0.95
handleQuitEachMethod · 0.95
saveMethod · 0.95
isMacOSMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected