Jump to content
Search Community

ContentDisplay objects getting garbage collected [SOLVED]

t0m test
Moderator Tag

Recommended Posts

hi,

 

i've got a problem with grabage collection it seems...

 

i have a whole bunch of image loaders, the content of which i need to use in different places at different times. i store a reference to the loader and to the ImageLoader.content as private class members, i'm even putting an Event.REMOVED_FROM_STAGE event listener on it and they keep getting garbage collected at random and so they disappear from the displayList.

 

surely something with an event listener and a stored reference shouldn't be getting GC'd but they are, i'm not removing them from the display list at least.

 

anyone got any idea what might be going on here?

 

my removed from stage listener traces...

 

"[object ContentDisplay]is being removed!!!"

 

thanks in advance,

 

tom.

Link to comment
Share on other sites

There must be something going on in your code, Tom. LoaderMax automatically stores references internally to all loaders which reference their content as well, so unless I'm sorely mistaken, there's no way they'd be getting garbage collected unless you dispose() them. And not a single other LoaderMax user has ever reported something like this, so I'm pretty confident it's not an issue with LoaderMax. I'd need to see your code to know what you might be doing to cause the issue. Feel free to post a simple example FLA that we can publish to see exactly what's going on. It doesn't need to be your production file(s) - just something super simple.

Link to comment
Share on other sites

There must be something going on in your code, Tom

 

actually i'm pretty sure you are right!

 

i think i'm not destroying other sections where the images are being used properly, at least, doing an addChild somewhere else would have the effect of removing the image from it's current displayList right?

 

sorry for the noise, just been going crazy trying to track down this bug! very close to finishing a prototype i have to demo tomorrow...

Link to comment
Share on other sites

i think i'm not destroying other sections where the images are being used properly, at least, doing an addChild somewhere else would have the effect of removing the image from it's current displayList right?

 

sorry for the noise, just been going crazy trying to track down this bug! very close to finishing a prototype i have to demo tomorrow...

 

Yep, a DisplayObject cannot exist in two places at once, so if you addChild() in one parent and then addChild() in another parent, it will remove it from the first parent.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...