---
title: "CFURLStopAccessingSecurityScopedResource(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlstopaccessingsecurityscopedresource(_:)"
---

# CFURLStopAccessingSecurityScopedResource(_:)

In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL.

## Declaration

```swift
func CFURLStopAccessingSecurityScopedResource(_ url: CFURL!)
```

## Parameters

- `url`: The security-scoped URL that points to the file-system resource you want to stop accessing.

## Discussion

Discussion When you no longer need access to a file or directory pointed to by a security-scoped URL, such as one returned by resolving a security-scoped bookmark, call this function (or its Cocoa equivalent, stopAccessingSecurityScopedResource()) on the URL. warning: You must balance every call to the CFURLStartAccessingSecurityScopedResource(_:) method with a corresponding call to the CFURLStopAccessingSecurityScopedResource(_:) method. If you fail to relinquish your access when you no longer need a file-system resource, your app leaks kernel resources. If sufficient kernel resources are leaked, your app loses its ability to add file-system locations to its sandbox, such as via Powerbox or security-scoped bookmarks, until relaunched. note: Security-scoped bookmarks are not available in versions of macOS prior to OS X v10.7.3.

## See Also

### Working with Bookmark Data

- [CFURLCreateBookmarkData(_:_:_:_:_:_:)](corefoundation/cfurlcreatebookmarkdata(_:_:_:_:_:_:).md)
- [CFURLCreateBookmarkDataFromAliasRecord(_:_:)](corefoundation/cfurlcreatebookmarkdatafromaliasrecord(_:_:).md)
- [CFURLCreateBookmarkDataFromFile(_:_:_:)](corefoundation/cfurlcreatebookmarkdatafromfile(_:_:_:).md)
- [CFURLWriteBookmarkDataToFile(_:_:_:_:)](corefoundation/cfurlwritebookmarkdatatofile(_:_:_:_:).md)
- [CFURLStartAccessingSecurityScopedResource(_:)](corefoundation/cfurlstartaccessingsecurityscopedresource(_:).md)
