Skip to content

Commit 1a9f673

Browse files
fixed that Painter didn't clean up properly in (closes #1147)
1 parent 3806fed commit 1a9f673

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

starling/src/starling/rendering/Painter.as

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,22 @@ package starling.rendering
158158
_stateStackLength = 0;
159159
}
160160

161-
/** Disposes all mesh batches, programs, and - if it is not being shared -
162-
* the render context. */
161+
/** Disposes all mesh batches and - if it is not being shared -
162+
* the render context and its programs. */
163163
public function dispose():void
164164
{
165+
_stage3D.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated);
165166
_batchProcessorCurr.dispose();
166167
_batchProcessorPrev.dispose();
167168
_batchProcessorSpec.dispose();
168169

169170
if (!_shareContext)
170171
{
172+
for each (var program:Program in programs)
173+
program.dispose();
174+
171175
if (_context) _context.dispose(false);
172-
sSharedData = new Dictionary();
176+
delete sSharedData[stage3D];
173177
}
174178
}
175179

0 commit comments

Comments
 (0)