Open openradar-mirror opened 5 years ago
CNView doesn't free added gesture recognizers after deinit. Please check out provided test case.
var wasDeallocated = false class MyGestureRecognizer: UIGestureRecognizer { deinit { wasDeallocated = true } }
class Foo { let scnView = SCNView() // test passes if change to UIView()
UIView()
init() { scnView.addGestureRecognizer(MyGestureRecognizer(target: self, action: #selector(test))) } @objc func test() { }
}
final class Test: XCTestCase { func testMemoryLeak() { autoreleasepool { _ = Foo() } XCTAssertTrue(wasDeallocated) } }
- Product Version: 12.0 Created: 2019-07-08T21:43:41.103009 Originated: 2019-07-09T00:00:00 Open Radar Link: http://www.openradar.me/6164844138987523
Description
CNView doesn't free added gesture recognizers after deinit. Please check out provided test case.
var wasDeallocated = false class MyGestureRecognizer: UIGestureRecognizer { deinit { wasDeallocated = true } }
class Foo { let scnView = SCNView() // test passes if change to
UIView()
}
final class Test: XCTestCase { func testMemoryLeak() { autoreleasepool { _ = Foo() } XCTAssertTrue(wasDeallocated) } }
- Product Version: 12.0 Created: 2019-07-08T21:43:41.103009 Originated: 2019-07-09T00:00:00 Open Radar Link: http://www.openradar.me/6164844138987523