Called to dispose of resources and shut down the sketch. Destroys the thread, dispose the renderer,and notify listeners. Not to be called or overriden by users. If called multiple times, will only notify listeners once. Register a dispose listener instead.
()
| 3823 | * will only notify listeners once. Register a dispose listener instead. |
| 3824 | */ |
| 3825 | public void dispose() { |
| 3826 | // moved here from stop() |
| 3827 | finished = true; // let the sketch know it is shut down time |
| 3828 | |
| 3829 | // don't run the disposers twice |
| 3830 | if (surface.stopThread()) { |
| 3831 | |
| 3832 | // shut down renderer |
| 3833 | if (g != null) { |
| 3834 | g.dispose(); |
| 3835 | } |
| 3836 | // run dispose() methods registered by libraries |
| 3837 | handleMethods("dispose"); |
| 3838 | } |
| 3839 | |
| 3840 | if (platform == MACOSX) { |
| 3841 | try { |
| 3842 | final String td = "processing.core.ThinkDifferent"; |
| 3843 | final Class<?> thinkDifferent = getClass().getClassLoader().loadClass(td); |
| 3844 | thinkDifferent.getMethod("cleanup").invoke(null); |
| 3845 | } catch (Exception e) { |
| 3846 | e.printStackTrace(); |
| 3847 | } |
| 3848 | } |
| 3849 | |
| 3850 | } |
| 3851 | |
| 3852 | |
| 3853 |
no test coverage detected