Property setter is a more appropriate place for manual reference counting.
Release window when closed to avoid problem with 0x0 context.