lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
245 stars 17 forks source link

6164844138987523: SCNView doesn't free added gesture recognizers after deinit #21302

Open openradar-mirror opened 5 years ago

openradar-mirror commented 5 years ago

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()

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