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

_notifyDelegate crash #1236

Open
x122536638 opened this issue Jun 25, 2021 · 1 comment
Open

_notifyDelegate crash #1236

x122536638 opened this issue Jun 25, 2021 · 1 comment

Comments

@x122536638
Copy link

x122536638 commented Jun 25, 2021

DTLazyImageView:

  • (void)_notifyDelegate
    {
    if ([self.delegate respondsToSelector:@selector(lazyImageView:didChangeImageSize:)]) {
    [self.delegate lazyImageView:self didChangeImageSize:CGSizeMake(_fullWidth, _fullHeight)];
    }
    }

when DTLazyImageView.delegtate is dealloc but DTLazyImageView.delegate is not nil,

#define DT_WEAK_PROPERTY assign
This is the reason, but how to solve it

  • thread Untitled #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x20)
    frame #0: 0x00000001a23e5ca0 libobjc.A.dylib`objc_retain + 16
    • frame Untitled #1: 0x0000000102836570 TangGuoApp-[DTLazyImageView _notifyDelegate](self=0x0000000105fbfd60, _cmd="_notifyDelegate") at DTLazyImageView.m:229:12 frame #2: 0x0000000102836768 TangGuoApp-[DTLazyImageView completeDownloadWithData:](self=0x0000000105fbfd60, _cmd="completeDownloadWithData:", data=540578 bytes) at DTLazyImageView.m:242:2
      frame Add HTML entity support #3: 0x00000001a2abaf94 Foundation`__NSThreadPerformPerform + 188
      frame Proper shifting of baseline for SUB and SUP #4: 0x00000001a2630d14
@odrobnik
Copy link
Collaborator

Looks to me you are building for a very old deployment target. If you don't use zeroing weak references, then you need to nil them yourself when the instances are deallocated.

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

No branches or pull requests

2 participants