MCPcopy Create free account
hub / github.com/benfry/processing4 / exit

Method exit

core/src/processing/core/PApplet.java:3362–3383  ·  view source on GitHub ↗

Quits/stops/exits the program. Programs without a draw() function exit automatically after the last line has run, but programs with draw() run continuously until the program is manually stopped or exit() is run. Rather than terminating immediately, exit() wil

()

Source from the content-addressed store, hash-verified

3360 * @webBrief Quits/stops/exits the program
3361 */
3362 public void exit() {
3363 if (surface.isStopped()) {
3364 // exit immediately, dispose() has already been called,
3365 // meaning that the main thread has long since exited
3366 exitActual();
3367
3368 } else if (looping) {
3369 // dispose() will be called as the thread exits
3370 finished = true;
3371 // tell the code to call exitActual() to do a System.exit()
3372 // once the next draw() has completed
3373 exitCalled = true;
3374
3375 } else { // !looping
3376 // if not looping, shut down things explicitly,
3377 // because the main thread will be sleeping
3378 dispose();
3379
3380 // now get out
3381 exitActual();
3382 }
3383 }
3384
3385
3386 public boolean exitCalled() {

Callers 15

handleKeyEventMethod · 0.95
windowDestroyNotifyMethod · 0.45
windowDestroyedMethod · 0.45
nativeMouseEventMethod · 0.45
handleDrawMethod · 0.45
exitActualMethod · 0.45
runSketchMethod · 0.45
initMethod · 0.45
windowClosingMethod · 0.45
mousePressedMethod · 0.45
initRunMethod · 0.45

Calls 3

exitActualMethod · 0.95
disposeMethod · 0.95
isStoppedMethod · 0.65

Tested by

no test coverage detected