Skip to content

Commit 717eb0e

Browse files
committed
fixed that Painter didn't clean up properly in dispose() (closes #190)
1 parent 68a8ded commit 717eb0e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/starling/rendering/Painter.hx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,18 @@ class Painter
199199
* the render context. */
200200
public function dispose():Void
201201
{
202+
_stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated);
202203
_batchProcessorCurr.dispose();
203204
_batchProcessorPrev.dispose();
204205
_batchProcessorSpec.dispose();
205206

206207
if (!_shareContext)
207208
{
209+
for (program in programs)
210+
program.dispose();
211+
208212
if (_context != null) _context.dispose(false);
209-
sSharedData = new Map();
213+
sSharedData.remove(_stage3D);
210214
}
211215
}
212216

0 commit comments

Comments
 (0)