Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory release #459

Closed
kojot1234 opened this issue Jan 7, 2013 · 6 comments
Closed

Memory release #459

kojot1234 opened this issue Jan 7, 2013 · 6 comments
Assignees
Labels

Comments

@kojot1234
Copy link

Calling AssetLibrary.removeAllAssets(); Will generate a null obj ref. (_methods)

Line 647-649 (DefaultScreenPass.as):
for (var i : uint = 0; i < _methods.length; ++i) {
addPasses(_methods[i].method.passes);
}

There should be a null check for _methods. When running
if (_methods != null) {
for (var i : uint = 0; i < _methods.length; ++i) {
addPasses(_methods[i].method.passes);
}
}

Also when disposing all bitmapData should be released.
Including _mipMaps in BitmapTexture.

@richardolsson
Copy link
Member

The removeAllAssets() function will dispose the assets, and you should not try to use the assets after they have been disposed. The purpose of the dispose() functions is to make an object available for garbage collection. Have you found that objects are not garbage collected after they have been disposed?

@kojot1234
Copy link
Author

Yes it does not seem to dispose _mipMaps Array in BitmapTexture.

@richardolsson
Copy link
Member

There is no need to "dispose" an array. As long as the array is not being directly or indirectly referenced by the root display list of your application, i.e. as long as you don't keep a reference to the texture lying around, it will be garbage collected.

@kojot1234
Copy link
Author

That's weird because the bitmapData that referenced inside that array did not get disposed so maybe there is a reference to it. I have used sharedContext with Starling for my project. I can dig deeper and report back.

@richardolsson
Copy link
Member

Well, regardless I guess it doesn't hurt to explicitly dispose. We'll make sure that happens in the next development cycle.

@ghost ghost assigned DerSchmale Jan 8, 2013
@kojot1234
Copy link
Author

Thank you, I'll still try to help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants