> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XAppCaptureUnRegisterMetadataPurged

> XAppCaptureUnRegisterMetadataPurged

Remove an event handler for meta data purge events.

## Syntax

```cpp theme={null}
bool XAppCaptureUnRegisterMetadataPurged(  
         XTaskQueueRegistrationToken token,  
         bool wait  
)  
```

### Parameters

*token*   \_In\_\
Type: XTaskQueueRegistrationToken

Event handler token created by [XAppCaptureRegisterMetadataPurged](https://docs.xbox.com/reference/system/xappcapture/functions/xappcaptureregistermetadatapurged.md).

*wait*   \_In\_\
Type: bool

Tells the unregister function to wait in the case that the callback function is running some blocking function.

### Return value

Type: bool

## Remarks

> [!NOTE]
>
> This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

Each instance of [XAppCaptureRegisterMetadataPurged](https://docs.xbox.com/reference/system/xappcapture/functions/xappcaptureregistermetadatapurged.md) needs to be followed by an instance of AppCaptureUnRegisterMetadataPurged when the event handler is no longer needed. Failure to remove the handle will result in a memory leak. It is recommended that you call this function after the app has finished capture activity or before the app is shut down.

## Requirements

**Header:** XAppCapture.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[GameDVR Overview](https://docs.xbox.com/build/console-features/game-dvr/gamedvr-broadcast.md)\
[XAppCapture Members](https://docs.xbox.com/reference/system/xappcapture/xappcapture_members.md)\
[XAppCaptureRegisterMetadataPurged](https://docs.xbox.com/reference/system/xappcapture/functions/xappcaptureregistermetadatapurged.md)


## Related topics

- [XAppCaptureRegisterMetadataPurged](https://docs.xbox.com/reference/system/xappcapture/functions/xappcaptureregistermetadatapurged.md)
- [XAppCapture (API contents)](https://docs.xbox.com/reference/system/xappcapture/xappcapture_members.md)
- [XTaskQueueRegistrationToken](https://docs.xbox.com/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
- [Using C# wrappers for GDK APIs in your Unity project](https://docs.xbox.com/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XAppCaptureMetadataPurgedCallback](https://docs.xbox.com/reference/system/xappcapture/functions/xappcapturemetadatapurgedcallback.md)
