I accept that there's a chance this is related to my own code, but since a small change in this code (see attachment) fixed the leak, I felt it was worth a bug report. I haven't been able to find a reduced example yet unfortunately. Let me know if you want me to explore a particular cause or need more input.
The text was updated successfully, but these errors were encountered:
Not to me. An obvious small example fails to replicate the problem, too.
Thomvis (JIRA User) Are you able to verify that an excess retain happens in this code (for example, using the Allocations instrument)? If so, what's the stack trace?
@mikeash Thanks for reminding me. It was the allocations instrument that initially pointed me in the direction of this code. A few observations:
I do see two retains and a single release when the function is called with the subject instance as the toVC. When it is called later as as the fromVC (when popping the VC), there is a single retain and release pair.
I've attached screenshots of the stacktraces where memory is allocated in the function. Not sure if related. (I could not resize the popover to reveal more info, because Instruments would crash)
I've attached the disassembly. It doesn't mean much to me, but perhaps it is of help.
Attachment: Download
Environment
Xcode 10.0 / Swift 4.2
Additional Detail from JIRA
md5: 1cbd33d5cb077ba1afa7b6f8bc6c1436
Issue Description:
The following code seems to leak `toVC`:
I accept that there's a chance this is related to my own code, but since a small change in this code (see attachment) fixed the leak, I felt it was worth a bug report. I haven't been able to find a reduced example yet unfortunately. Let me know if you want me to explore a particular cause or need more input.
The text was updated successfully, but these errors were encountered: