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

yy_attachmentStringWithContent内存泄露 #994

Open
a130785 opened this issue Jan 10, 2024 · 4 comments
Open

yy_attachmentStringWithContent内存泄露 #994

a130785 opened this issue Jan 10, 2024 · 4 comments

Comments

@a130785
Copy link

a130785 commented Jan 10, 2024

UIImageView *image = [UIImageView new];
attachment = [NSMutableAttributedString yy_attachmentStringWithContent:image contentMode:UIViewContentModeCenter attachmentSize:image.size alignToFont:font alignment:YYTextVerticalAlignmentCenter];
[text appendAttributedString: attachment];

yy_attachmentStringWithContent当我为Content设置一个image view时,会报内存泄露。

IMG_5966

为什么要设置UIImageView而不是image,因为我需要先显示占位图在富文本中,然后异步加载图片,加载成功后再更新UIImageView的image。

但是这个内存泄露不知道要怎么解决,weak UIImageView和页面消失的时候移除UIImageView都没有用。

@eliswee
Copy link

eliswee commented Feb 4, 2024

你这个内存泄露用什么检测的?

@a130785
Copy link
Author

a130785 commented Feb 20, 2024

FBRetainCycleDetector 和 MLeaksFinder

@eliswee
Copy link

eliswee commented Feb 22, 2024

明白~感谢~

@LxwYl
Copy link

LxwYl commented Mar 15, 2024

你好,如果不知道image的大小,想做异步的话,怎么更新 attachmentSize

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

3 participants