<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSVirtualMachine/removeManagedReference(_:withOwner:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:objc(cs)JSVirtualMachine(im)removeManagedReference:withOwner:"
  },
  "title" : "removeManagedReference(_:withOwner:)"
}
-->

# removeManagedReference(_:withOwner:)

Notifies the JavaScriptCore virtual machine that a previously registered object relationship no longer exists.

```
func removeManagedReference(_ object: Any!, withOwner owner: Any!)
```

## Parameters

`object`

The object formerly referenced by the JavaScript memory management graph.

`owner`

The other object responsible for the lifetime of the reference.

## Discussion

Use this method to deregister object relationships recorded using the [`addManagedReference(_:withOwner:)`](/documentation/JavaScriptCore/JSVirtualMachine/addManagedReference(_:withOwner:)) method.

The JavaScript garbage collector continues to scan any references that were reported to it until you use this method to remove those references.

---

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)