iOS10 中的 MKMapView 仪器内存泄漏

MKMapView Instruments Memory Leak in iOS10

我创建了一个测试项目来追踪我在使用 MKMapView 时在 Instruments 中看到的泄漏。

这是我的 MapViewController 代码:

import UIKit
import MapKit

class MapViewController: UIViewController {

    @IBOutlet var mapView: MKMapView!

    deinit {
        print(#file, #function)
    }

}

当我关闭此 VC 时,会打印 deinit 行,但 Instruments 会记录内存泄漏。 (注意:我在设备上测试,而不是模拟器。) deinit 告诉我 mapView 被正确释放,所以我不明白为什么我有内存泄漏,除非它是 Apple 代码中的泄漏。这是 Instruments 屏幕截图。

Instruments Screenshot

对于那些好奇的人,跟踪 Instruments 中的泄漏会在测试项目中显示另一个 VC,它是空的。下面是截图。

Code leak pointer in Instruments

是我的代码有问题,还是 Apple 代码泄露? TIA

这是一个错误,已报告给 Apple。它似乎已在 iOS 11.

中得到更正