Release memory after the NSWindow closes.