Merge pull request #5384 from hazmatsuitor/master

fix NPE when closing sketch window on Mac (#5214)
This commit is contained in:
Ben Fry
2018-03-13 19:55:27 -04:00
committed by GitHub
+1 -2
View File
@@ -3703,8 +3703,7 @@ public class PApplet implements PConstants {
if (platform == MACOSX) {
try {
final String td = "processing.core.ThinkDifferent";
final Class<?> thinkDifferent =
Thread.currentThread().getContextClassLoader().loadClass(td);
final Class<?> thinkDifferent = getClass().getClassLoader().loadClass(td);
thinkDifferent.getMethod("cleanup").invoke(null);
} catch (Exception e) {
e.printStackTrace();