I have the same issue, with Swift, in 2022.
Post
Replies
Boosts
Views
Activity
This turns out to be either a misunderstanding of, or possibly a bug in, the way DifferenceKit interacts with a view-based, rather than objectValue-based, NSTableView.
I was crucially not checking the values with which reloadData(forRowIndexes:columnIndexes) was called, and the columnIndexes passed by DifferenceKit's algorithm were always [0], which was not valid for any visible cells as my first column is hidden, so the methods weren't called.
The useful lesson here is that when a tableview's delegate lacks tableView(_:viewFor:row:), a reload to any column reloads the entire row, but once views are specified, the column values become relevant.
Looking closer at the debug memory graph it seemed that the autoreleasepool holding the audio buffer was too long-lived. I've not worked closely with these pools before but I was able to solve the memory issue by closely wrapping the conversion call in its own pool:
_ = autoreleasepool {
converter.convert(
to: outputBuffer,
error: nil,
withInputFrom: converterInputBlock
)
}
This appears to correctly scope the lifetime of the buffers. If anyone has a good explanation for this I'd love to hear it!