Sha256: 4af8f43824bc1df324b3b3ef3062566000d6d0d9ee4f75db3010afa13bf0cf9d

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

Index: core/src/processing/core/PApplet.java
===================================================================
--- core/src/processing/core/PApplet.java	(revision 5371)
+++ core/src/processing/core/PApplet.java	(working copy)
@@ -1386,7 +1386,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()

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-processing-1.0.9 lib/patches/PApplet.diff
ruby-processing-1.0.4 lib/patches/PApplet.diff
ruby-processing-1.0.5 lib/patches/PApplet.diff
ruby-processing-1.0.6 lib/patches/PApplet.diff
ruby-processing-1.0.7 lib/patches/PApplet.diff
ruby-processing-1.0.8 lib/patches/PApplet.diff