|11-24-2011, 09:33 PM||#1|
Join Date: Feb 2009
how to reset a layer properly ?
I'm using wwj to load dynamiclly WWicon from a databse every seconds , insert them in a renderbale layer and display them .
It's working but if I let my application work for a long time (2 hours) I get an out of memory exception .
I'm clearing the content of the layer with this piece of code but I thinks that it's not enough to free the memory :
layerVol.removeAllIcons(); layerVol.resetListeVol(); layerVol.dispose();
|12-06-2011, 07:36 PM||#2|
Join Date: Jul 2011
Sounds like a memory leak of some sort.
Not sure if you're just reusing layerVol as a container, or making a new layerVol every time you regenerate the layer, but check to see if layerVol.dispose() sets layerVol to null. If not you might want to try this before calling
|12-07-2011, 06:03 PM||#3|
Join Date: Feb 2008
Location: Melbourne, FL, USA
removeAllIcons(); // clears the collection
resetListeVol(); // doesn't exist as far as i can tell
dispose(); // does nothing in an IconLayer
your issue is probably with the renderables and tc's proably spot on with a garbage collection issue. make sure your not holding a reference to the images anywhere but in the renderable.