/
processing-1.5.1.patch
executable file
·35 lines (31 loc) · 1.26 KB
/
processing-1.5.1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- processing-1.5.1/core/src/processing/core/PApplet.java 2011-05-15 19:02:53.000000000 +0200
+++ ../processing-1.5.1/core/src/processing/core/PApplet.java 2011-09-20 15:19:23.009455091 +0200
@@ -1611,7 +1611,22 @@
} catch (RendererChangeException e) {
// Give up, instead set the new renderer and re-attempt setup()
return;
+
+ // Catch a JRuby exception so that the RendererChangeExceptions
+ // that we're looking for don't get stuck in Ruby-space.
+ } catch (RuntimeException e) {
+ String message = e.getMessage();
+ String name = RendererChangeException.class.getName();
+ String regex = "(?s).*" + name + ".*";
+ regex = regex.replace("$", "\\$");
+ if (message != null && message.matches(regex)) {
+ // Give up, instead set the new renderer and re-attempt setup()
+ return;
+ } else {
+ throw e;
+ }
}
+
this.defaultSize = false;
} else { // frameCount > 0, meaning an actual draw()
@@ -1665,6 +1680,9 @@
}
}
+ public boolean isAnimationThreadTerminated() {
+ return thread.getState() == Thread.State.TERMINATED;
+ }
//////////////////////////////////////////////////////////////