Clear the global PGL on dispose().

This commit is contained in:
Jonathan Feinberg
2013-12-25 22:53:05 -05:00
parent 0f0f2b2e50
commit 8de31e2b5d

View File

@@ -651,9 +651,13 @@ public class PGraphicsOpenGL extends PGraphics {
deleteFinalizedGLResources();
if (primarySurface) pgl.deleteSurface();
// This next line is critical to release many static allocations.
// This is important in the context of, say, a unit test suite, which
// runs more than one OpenGL sketch within the same classloader
// (as in the case of processing.py). Please don't remove it!
pgl = null;
}
// @Override
@Override
protected void finalize() throws Throwable {
try {