一旦创建一个空项目,Swift iOS项目就会泄漏

问题描述:

我已经看到很多有关误报"的声音,甚至我自己也遇到过.

I've seen a fair bit of noise about "false positives," and have even encountered them, myself.

但是,这是蛋糕.

使用Swift 5/Xcode 10.2易于复制,可以创建一个新的单视图iOS应用.

Easy to reproduce, using Swift 5/Xcode 10.2, create a new single-view iOS app.

跑漏气.

您会得到这些生物:

Malloc 64 Bytes 1   0x600001d084c0  64 Bytes    Foundation  +[NSString stringWithUTF8String:]
Malloc 16 Bytes 3   < multiple >    48 Bytes         
Malloc 1.50 KiB 3   < multiple >    4.50 KiB         
Malloc 32 Bytes 3   < multiple >    96 Bytes         
Malloc 8.00 KiB 1   0x7fc56f000c00  8.00 KiB         
Malloc 64 Bytes 10  < multiple >    640 Bytes        
Malloc 80 Bytes 3   < multiple >    240 Bytes        
Malloc 4.00 KiB 3   < multiple >    12.00 KiB        

使用模拟器(XR,iOS 12.2).

Using the simulator (XR, iOS 12.2).

第一个具有堆栈跟踪,但是它一文不值.

That first one has a stack trace, but it's worthless.

有什么办法可以纠正这种噪音?我正在编写基础结构组件,并且需要:

Is there some way that I can correct for this noise? I'm writing an infrastructure component, and I need to:

A)该死,确保它不会泄漏,并且

A) Make damn sure it doesn't leak, and

B)地球上没有每个Cocoapod骑师向我发送电子邮件,并告诉我我的组件泄漏了.

B) Not have every Cocoapod jockey on Earth emailing me, and telling me that my component leaks.

如果使用iOS 12.1模拟器,则leak工具仍然可以使用(Swift 5/Xcode 10.2).目前,我们希望它将在将来的版本中修复.

If using a iOS 12.1 simulator , the leak instrument still can work (Swift 5/Xcode 10.2). Currently we are hoping it will be fixed in future versions.