<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/isReleasedWhenClosed",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(py)releasedWhenClosed"
  },
  "title" : "isReleasedWhenClosed"
}
-->

# isReleasedWhenClosed

A Boolean value that indicates whether the window is released when it receives the `close` message.

```
var isReleasedWhenClosed: Bool { get set }
```

## Discussion

The value of this property is <doc://com.apple.documentation/documentation/Swift/true> if the window is automatically released after being closed; <doc://com.apple.documentation/documentation/Swift/false> if it’s simply removed from the screen.

The default for `NSWindow` is <doc://com.apple.documentation/documentation/Swift/true>; the default for `NSPanel` is <doc://com.apple.documentation/documentation/Swift/false>. Release when closed, however, is ignored for windows owned by window controllers.

> Warning: Swift and Automatic Reference Counting (ARC) clients need to set this property to <doc://com.apple.documentation/documentation/Swift/false> to avoid releasing the window too many times.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)