Swift NSTableHeaderCell subclass crashes upon release if it has a String property

Originator:christian.tietze
Number:rdar://26349281 Date Originated:2016-05-18
Status:Open Resolved:Duplicate of 16582844
Product:OS X SDK Product Version:
Classification: Reproducible:
 
Summary:
NSTableHeaderCell subclasses crash upon release when columns are removed if they have a String property that references another String like so: 
cell.property= "\(otherString)"

Other properties (including custom struct) seem to work.

Steps to Reproduce:
Create NSTableHeaderCell subclass "TableHeaderCell"

1. Add columns on button press:
2. Set a String in the view controller called `content` (or anything else)
3. Create new TableHeaderCell and set its custom property to "\(content)"
4. Create new column with its headerCell set to the instance from (3)
5. Add column to table view
6. Remove columns on button press
7. See (1)

Expected Results:
When pressing the button, the table columns should be created, then removed, then created, etc.

Actual Results:
The application crashes; with NSZombies enabled, it reports some totally unrelated object to be the cause

Version:
Version 7.3.1 (7D1014)
Mac OS 10.11.4 (15E65)

Notes:
The attached project archive contains a Swift and a ObjC version; only the Swift version crashes. Always some ivar release issue.

Configuration:
Crashes for Swift; works fine in Objective-C

Attachments:
'TableZombies.zip' was successfully uploaded.



---

See Gist for the code:
https://gist.github.com/DivineDominion/c069c8d3d38d7cb880b5354524acf579

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!