a1049145827 / BSText

Attribute Text Framework For iOS
MIT License
278 stars 58 forks source link

BSText 会内存泄漏 #13

Open privatestring opened 4 years ago

a1049145827 commented 4 years ago

感谢提醒,我会排查一下

johnil commented 1 year ago
public class func remove(_ target: TextDebugTarget?) { 
    sharedDebugLock.wait()
    sharedDebugTargets.addObject(target)
    sharedDebugLock.signal()
}

DebugOption的释放部分错误代码引起了内存泄露,remove的时机也有问题。周知。

https://github.com/a1049145827/BSText/blob/c73a915cf5f908cc3113716981795f1d3d41704c/BSText/Component/TextDebugOption.swift#L155

https://github.com/a1049145827/BSText/blob/c73a915cf5f908cc3113716981795f1d3d41704c/BSText/BSLabel.swift#L1153

a1049145827 commented 1 year ago

好的,感谢

a1049145827 commented 1 year ago

我看这个代码确实是有错误,但是应该不会导致内存泄露,因为这个NSPointerArray 里的对象是 Unsafe Unretain 的

myouzh commented 11 months ago

确实有内存泄漏,是不是别的地方导致的呢?大佬帮忙维护解决一下吧