---
title: "CFRunLoopSourceInvalidate(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfrunloopsourceinvalidate(_:)"
---

# CFRunLoopSourceInvalidate(_:)

Invalidates a CFRunLoopSource object, stopping it from ever firing again.

## Declaration

```swift
func CFRunLoopSourceInvalidate(_ source: CFRunLoopSource!)
```

## Parameters

- `source`: The run loop source to invalidate.

## Discussion

Discussion Once invalidated, source will never fire and call its perform callback function again. This function automatically removes source from all the run loop modes in which it was registered. If source is a version 0 source, this function calls its cancel callback function as it is removed from each run loop mode. The memory for source is not deallocated unless the run loop held the only reference to source.

## See Also

### CFRunLoopSource Miscellaneous Functions

- [CFRunLoopSourceCreate(_:_:_:)](corefoundation/cfrunloopsourcecreate(_:_:_:).md)
- [CFRunLoopSourceGetContext(_:_:)](corefoundation/cfrunloopsourcegetcontext(_:_:).md)
- [CFRunLoopSourceGetOrder(_:)](corefoundation/cfrunloopsourcegetorder(_:).md)
- [CFRunLoopSourceGetTypeID()](corefoundation/cfrunloopsourcegettypeid().md)
- [CFRunLoopSourceIsValid(_:)](corefoundation/cfrunloopsourceisvalid(_:).md)
- [CFRunLoopSourceSignal(_:)](corefoundation/cfrunloopsourcesignal(_:).md)
