mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-13 09:50:17 +00:00
Correct block self references to strongSelf (#1231)
This commit is contained in:
parent
ce78fa00df
commit
771c068ad6
@ -729,17 +729,17 @@ static std::atomic_bool _useMainThreadDelegateCallbacks(true);
|
|||||||
void (^calloutBlock)(ASNetworkImageNode *inst);
|
void (^calloutBlock)(ASNetworkImageNode *inst);
|
||||||
|
|
||||||
if (newImage) {
|
if (newImage) {
|
||||||
if (self->_delegateFlags.delegateDidLoadImageWithInfo) {
|
if (strongSelf->_delegateFlags.delegateDidLoadImageWithInfo) {
|
||||||
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
||||||
let info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:imageSource downloadIdentifier:downloadIdentifier userInfo:userInfo];
|
let info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:imageSource downloadIdentifier:downloadIdentifier userInfo:userInfo];
|
||||||
[delegate imageNode:strongSelf didLoadImage:newImage info:info];
|
[delegate imageNode:strongSelf didLoadImage:newImage info:info];
|
||||||
};
|
};
|
||||||
} else if (self->_delegateFlags.delegateDidLoadImage) {
|
} else if (strongSelf->_delegateFlags.delegateDidLoadImage) {
|
||||||
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
||||||
[delegate imageNode:strongSelf didLoadImage:newImage];
|
[delegate imageNode:strongSelf didLoadImage:newImage];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else if (error && self->_delegateFlags.delegateDidFailWithError) {
|
} else if (error && strongSelf->_delegateFlags.delegateDidFailWithError) {
|
||||||
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
calloutBlock = ^(ASNetworkImageNode *strongSelf) {
|
||||||
[delegate imageNode:strongSelf didFailWithError:error];
|
[delegate imageNode:strongSelf didFailWithError:error];
|
||||||
};
|
};
|
||||||
@ -753,7 +753,7 @@ static std::atomic_bool _useMainThreadDelegateCallbacks(true);
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
calloutBlock(self);
|
calloutBlock(strongSelf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user