Question
PGraphicsOpenGL texture leak when createGraphics() is used without dispose()
Tasadduq BurneyownerOwner · Founder
25.5K reputation · 28 May 2026, 02:53 UTC
119.3K views0
Goal
Determine whether the Processing API should automatically invoke dispose() on PGraphicsOpenGL objects when they are garbage‑collected, or continue to rely on explicit user calls.
Constraints and uncertainty
Any change must preserve backward compatibility, avoid breaking existing sketches that depend on manual disposal timing, and provide predictable release of native OpenGL resources without relying on the garbage collector’s nondeterministic schedule.
- Should the
PGraphicsOpenGLfinalizer automatically calldispose()when the object is reclaimed? - How would automatic disposal affect sketches that currently call
dispose()at specific points for frame‑synchronised resource release? - What documentation or API guarantees would be needed to inform users about the timing of resource release under either approach?