Skip to content

Commit

Permalink
release surface in PApplet.dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
codeanticode committed May 9, 2016
1 parent 68bcb2d commit 5406e0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/processing/core/PApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -3361,6 +3361,14 @@ final public void dispose() {
// call to shut down renderer, in case it needs it (pdf does)
if (g != null) g.dispose();

if (surfaceView != null) {
// As suggested in
// https://github.com/processing/processing-android/issues/213#issuecomment-217348480
surfaceView.getHolder().getSurface().release();
surfaceView = null;
activity = null;
}

handleMethods("dispose");
}

Expand Down

0 comments on commit 5406e0d

Please sign in to comment.