---
title: UnregisterComponent
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: coreservices/1516645-unregistercomponent
---

# UnregisterComponent

Removes a component from the Component Manager’s registration list.

## Declaration

```occ
OSErr UnregisterComponent(Component aComponent);
```

## Parameters

- `aComponent`: The component to be removed. Applications that register components may obtain this identifier from the [doc://com.apple.documentation/documentation/coreservices/1516537-registercomponent](coreservices/1516537-registercomponent.md) or [doc://com.apple.documentation/documentation/coreservices/1516594-registercomponentresource](coreservices/1516594-registercomponentresource.md) functions. The component must not be in use by any applications or components. You can use a component instance here, but you must coerce the data type appropriately.

## Return Value

A result code. See [Result Codes](carbon_core/component_manager.md). If there are open connections to the component, returns a `validInstancesExist` error.

## Discussion

Most components are registered at startup and remain registered until the computer is shut down. However, you may want to provide some services temporarily. In that case you dispose of the component that provides the temporary service by using this function. 

## See Also

### Registering Components

- [RegisterComponent](1516537-registercomponent.md)
- [RegisterComponentResource](1516594-registercomponentresource.md)
- [RegisterComponentResourceFile](1516511-registercomponentresourcefile.md)
- [RegisterComponentFileRef](1516564-registercomponentfileref.md)
- [RegisterComponentFileRefEntries](1516395-registercomponentfilerefentries.md)
