> ## 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.

# XGameSaveCloseContainer

> XGameSaveCloseContainer

# XGameSaveCloseContainer

Closes the XGameSaveContainer.

## Syntax

```cpp theme={null}
void XGameSaveCloseContainer(  
         XGameSaveContainerHandle context  
)  
```

### Parameters

*context*   \_In\_\
Type: XGameSaveContainerHandle

Handle to the XGameSaveContainer to be closed.

### Return value

Type: void

Function result.

## 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).</Note>

Call this function when you have finished using the container. If you do not close the context handle for a container you will cause a memory leak. Every call made to [XGameSaveCreateContainer](/reference/system/xgamesave/functions/xgamesavecreatecontainer) should have a matching call to **XGameSaveCloseContainer**.

## Requirements

**Header:** XGameSave.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

[XGameSave](/reference/system/xgamesave/xgamesave_members)\
[XGameSaveCreateContainer](/reference/system/xgamesave/functions/xgamesavecreatecontainer)\
[Debugging Game Saves](/build/core-features/common/game-save/game-saves-debugging)


## Related topics

- [XGameSave API overview](/build/core-features/common/game-save/xgamesave.md)
- [XGameSave](/reference/system/xgamesave/xgamesave_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameSaveContainerInfo](/reference/system/xgamesave/structs/xgamesavecontainerinfo.md)
- [XGameSaveCreateContainer](/reference/system/xgamesave/functions/xgamesavecreatecontainer.md)
