commit 22f537a5a336d93d9ba2c001566f27e77c2daa38
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Jul 22 23:09:06 2020 +0100

    Correct a subtle bug iin Framebuffer: in recreate(), we need to mark the FBOs as deleted on GPU; otherwise later we might delete them - and when we do, they might belong to another Framebuffer already!

diff --git a/src/main/java/org/distorted/library/main/DistortedFramebuffer.java b/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
index a0f7fa8..d3100dc 100644
--- a/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
+++ b/src/main/java/org/distorted/library/main/DistortedFramebuffer.java
@@ -187,8 +187,15 @@ public class DistortedFramebuffer extends InternalOutputSurface
       for(int i=0; i<mNumFBOs; i++) mDepthStencilH[i] = 0;
       }
 
-    GLES30.glDeleteFramebuffers(mNumFBOs, mFBOH, 0);
-    for(int i=0; i<mNumFBOs; i++) mFBOH[i] = 0;
+    if( mNumFBOs>0 && mFBOH[0]>0 )
+      {
+      GLES30.glDeleteFramebuffers(mNumFBOs, mFBOH, 0);
+      }
+
+    for(int i=0; i<mNumFBOs; i++)
+      {
+      mFBOH[i] = 0;
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -206,6 +213,10 @@ public class DistortedFramebuffer extends InternalOutputSurface
       mDepthStencilCreated = NOT_CREATED_YET;
       mDepthStencilH[0] = 0;
       }
+    for(int i=0; i<mNumFBOs; i++)
+      {
+      mFBOH[i] = 0;
+      }
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
