You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced a memory leak in the rendering process. After a render call renderables still were refrenced by RenderableListItem s and RenderableListItem s still had references to the next.
I fixed the leak by
adding a function resetIndex to RenderableListItemPool,
editing the function freeAll in RenderableListItemPool,
and changing the calls EntityCollector performs to _renderableListItemPool instance.
Here's the changes:
RenderableListItemPool.as:
ADDED
public function resetIndex():void
{
_index = 0;
}
EDITED
public function freeAll() : void
{
var item:RenderableListItem;
while(_index-->0){
item = _pool[_index];
item.renderable = null;
item.next = null;
}
}
EntityCollector.as
[EDITED]
public function clear() : void
{
_numTriangles = _numMouseEnableds = 0;
_blendedRenderableHead = null;
_opaqueRenderableHead = null;
_renderableListItemPool.resetIndex(); // << call resetIndex instead of freeAll
if (_numLights > 0) _lights.length = _numLights = 0;
}
[EDITED]
public function cleanUp() : void
{
if (_numEntities > 0) {
for (var i : uint = 0; i < _numEntities; ++i)
_entities[i].popModelViewProjection();
_entities.length = _numEntities = 0;
_renderableListItemPool.freeAll(); // << added!
}
}
ciao,
pigiuz
The text was updated successfully, but these errors were encountered:
MichaelPlank
pushed a commit
to Pro3Games/away3d-core-broomstick
that referenced
this issue
Sep 20, 2011
I experienced a memory leak in the rendering process. After a render call renderables still were refrenced by RenderableListItem s and RenderableListItem s still had references to the next.
I fixed the leak by
adding a function resetIndex to RenderableListItemPool,
editing the function freeAll in RenderableListItemPool,
and changing the calls EntityCollector performs to _renderableListItemPool instance.
Here's the changes:
RenderableListItemPool.as:
ADDED
public function resetIndex():void
{
_index = 0;
}
EDITED
public function freeAll() : void
{
var item:RenderableListItem;
while(_index-->0){
item = _pool[_index];
item.renderable = null;
item.next = null;
}
}
EntityCollector.as
[EDITED]
public function clear() : void
{
_numTriangles = _numMouseEnableds = 0;
_blendedRenderableHead = null;
_opaqueRenderableHead = null;
_renderableListItemPool.resetIndex(); // << call resetIndex instead of freeAll
if (_numLights > 0) _lights.length = _numLights = 0;
}
[EDITED]
public function cleanUp() : void
{
if (_numEntities > 0) {
for (var i : uint = 0; i < _numEntities; ++i)
_entities[i].popModelViewProjection();
_entities.length = _numEntities = 0;
_renderableListItemPool.freeAll(); // << added!
}
}
ciao,
pigiuz
The text was updated successfully, but these errors were encountered: