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

# XStoreCloseContextHandle

> XStoreCloseContextHandle

# XStoreCloseContextHandle

关闭指定的应用商店上下文句柄。

## 语法

```cpp theme={null}
void XStoreCloseContextHandle(  
         XStoreContextHandle storeContextHandle  
)  
```

### 参数

*storeContextHandle*   \_In\_\
类型：XStoreContextHandle

要关闭的句柄。

### 返回值

类型：void

## 备注

此函数可在时间敏感线程上安全调用。

此函数关闭由 [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext) 创建的 **XStoreContextHandle**。如果未通过此函数关闭应用商店上下文句柄，则会导致内存泄漏。最佳做法是在清理过程中调用此函数以关闭所有剩余的 **XStoreConextHandles**。有关用法示例，请参阅 [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext)。

## 要求

**头文件：** XStore.h（包含于 XGameRuntime.h 中）

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)\
[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext)


## Related topics

- [XStoreCreateContext](/zh-CN/reference/system/xstore/functions/xstorecreatecontext.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStore](/zh-CN/reference/system/xstore/xstore_members.md)
- [XStoreCloseLicenseHandle](/zh-CN/reference/system/xstore/functions/xstorecloselicensehandle.md)
- [XStoreCloseProductsQueryHandle](/zh-CN/reference/system/xstore/functions/xstorecloseproductsqueryhandle.md)
