Q:  I am writing a simple editor program, which loads in a nib file for each document created.  I noticed with MallocDebug that there is a consistent leak of  22 bytes for every newly created document window, even though the documentation says that the default window is to be freed when closed.  Why is it leaking?

A:  The default window created with InterfaceBuilder is somewhat different from the default window created with the methods alloc and initContent:style:backing:buttonMask.  The InterfaceBuilder default window is not automatically freed when closed.  To fix this problem, simply check the "Free when closed" option in the Window Attributes Panel, using the InterfaceBuilder Projects inspector.

QA790

Valid for 1.0, 2.0, 3.0