Skip to content

Conversation

@AndreiArdelean1
Copy link
Contributor

Fixes #12

@dreampiggy
Copy link
Collaborator

Opppps...Seems this leak exists long times ago.

I'll run Xcode analayze and memory leak detection after merging your PR as well.

@dreampiggy dreampiggy merged commit 42e5637 into SDWebImage:master Oct 24, 2023
@dreampiggy
Copy link
Collaborator

dreampiggy commented Oct 24, 2023

Seems there are more issues after changes

image

@dreampiggy
Copy link
Collaborator

dreampiggy commented Oct 24, 2023

The correct fix should be:

{
    ...   
    NSData *result = [pdfData copy];
    
    CGDataConsumerRelease(pdfConsumer);
    CGContextRelease(context);

    return result;
}

The CGImageRef is GET rule (because it's get from UIImage's own buffer), so do not call Release on it.

@dreampiggy
Copy link
Collaborator

Released v1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in +[SDImagePDFCoder createPDFDataWithBitmapImage:]

2 participants