Fixes a crash on Lion, where NSWindow does not support weak references.