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

The operation will not be release after completed. #772

Closed
Whirlwind opened this issue Jun 19, 2014 · 7 comments
Closed

The operation will not be release after completed. #772

Whirlwind opened this issue Jun 19, 2014 · 7 comments
Labels
Milestone

Comments

@Whirlwind
Copy link
Contributor

The operation be added to AssociatedObject, and be removed when cancel or set image url.

But it will NOT be removed from AssociatedObject after completed.

Is it right?

@bpoplauschi
Copy link
Member

I don't think we need to, since the operation is going to be deallocated. @rs am I right?

@bpoplauschi bpoplauschi added this to the 3.7.0 milestone Jun 24, 2014
@Whirlwind
Copy link
Contributor Author

I don't think so. The operation is be retained with OBJC_ASSOCIATION_RETAIN_NONATOMIC.

@bpoplauschi
Copy link
Member

You are right. The operation is retained and stored using OBJC_ASSOCIATION_RETAIN_NONATOMIC. The reason why we didn't see leaks here is:

  • when trying to set a new image from url, we first call cancelCurrentImageLoad that will set the old operation to nil.

@bpoplauschi
Copy link
Member

@rs do you think we should set the operation to nil after the completion block is called aka when the operation is finished?

@rs
Copy link
Member

rs commented Jun 24, 2014

Yes

@bpoplauschi bpoplauschi modified the milestones: Future, 3.7.0 Jun 25, 2014
@bpoplauschi
Copy link
Member

@Whirlwind could you make a pull request with this fix? You are more familiar with this code, after your changes in #771

@bpoplauschi
Copy link
Member

Actually, #771 removes the storage of operation, so this no longer applies.

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