Skip to content

[ASImageNode / PINRemoteImage] Support WebP. #117

Description

@garrettmoon

From @smyrgl on December 18, 2015 22:2

I have created a sample project to demonstrate this behavior here: https://github.com/smyrgl/adktest

So here's what I'm noticing: it seems that in ASCollectionView the memory isn't properly being freed up. This is very easy to see in the sample project: just play around with clicking on items in the collection view (each will push to another collection view) and scroll and watch the memory usage continue to increase. Firing memory warnings will not change this behavior, the memory usage just keeps climbing.

screen shot 2015-12-18 at 1 53 40 pm

However if in the ASCellNode I manually implement clearContents like this:

    override func clearContents() {
        super.clearContents()
        imageNode.image = nil
    }

Then memory usage stays under control. Also if I define a custom subclass of ASImageNode that implements clearContents I also get the correct memory behavior:

class ClearImageNode: ASImageNode {
    override func clearContents() {
        super.clearContents()
        image = nil
    }
}

screen shot 2015-12-18 at 2 02 07 pm

I'd be glad to create a diff which adds this to ASImageNode but I am uncertain if there is a gotcha to this change.

Copied from original issue: facebookarchive/AsyncDisplayKit#955

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions