Re: NSWindowController and window release


Graham Cox
 

OK, I figured it out.

What was important to me was that the custom view was deallocated. Therefore it was the view’s -dealloc I was logging, not the window’s. I inferred, incorrectly, that it was the window that wasn’t going away. In fact it was, but the view wasn’t.

The custom view is set up as a layer hosting view, and I set the view to be the layer’s -layoutManager. That’s a strong property, so a retain cycle was created there.

Once understood, easily solved.

I do vaguely recollect something about this possibility in documentation a long time ago, but going through it just now, could find no mention of it. In the end, the only canonical documentation is the headers. Ho hum.


—Graham

On 27 Jul 2017, at 9:39 pm, Graham Cox <graham@...> wrote:

Here we go again… another memory management issue.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.