MCPcopy Index your code
hub / github.com/benfry/processing4 / dispose

Method dispose

core/src/processing/core/PApplet.java:3408–3433  ·  view source on GitHub ↗

Called to dispose of resources and shut down the sketch. Destroys the thread, dispose the renderer,and notify listeners. Not to be called or overridden by users. If called multiple times, will only notify listeners once. Register a "dispose" listener instead.

()

Source from the content-addressed store, hash-verified

3406 * will only notify listeners once. Register a "dispose" listener instead.
3407 */
3408 public void dispose() {
3409 // moved here from stop()
3410 finished = true; // let the sketch know it is shut down time
3411
3412 // don't run the disposers twice
3413 if (surface.stopThread()) {
3414
3415 // shut down renderer
3416 if (g != null) {
3417 g.dispose();
3418 }
3419 // run dispose() methods registered by libraries
3420 handleMethods("dispose");
3421 }
3422
3423 if (platform == MACOS) {
3424 try {
3425 final String td = "processing.core.ThinkDifferent";
3426 final Class<?> thinkDifferent = getClass().getClassLoader().loadClass(td);
3427 thinkDifferent.getMethod("cleanup").invoke(null);
3428 } catch (Exception e) {
3429 e.printStackTrace();
3430 }
3431 }
3432
3433 }
3434
3435
3436

Callers 4

dieMethod · 0.95
exitMethod · 0.95
runMethod · 0.45
endRecordMethod · 0.45

Calls 6

handleMethodsMethod · 0.95
loadClassMethod · 0.80
getClassLoaderMethod · 0.80
getMethodMethod · 0.80
stopThreadMethod · 0.65
printStackTraceMethod · 0.45

Tested by

no test coverage detected