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

# XApuDisconnect

> XApuDisconnect

# XApuDisconnect

하드웨어 서버와의 연결을 끊고 [XApuConnect](/reference/audio/xapu/functions/xapuconnect) 중에 할당된 모든 리소스를 해제합니다.

## Syntax

```cpp theme={null}
HRESULT XApuDisconnect(  
         XApuHandle handle  
)  
```

### Parameters

*handle*   \_In\_\
Type: XApuHandle

[XApuConnect](/reference/audio/xapu/functions/xapuconnect)를 호출하여 반환된 핸들입니다.

### Return value

Type: HRESULT

성공 시 `S_OK`를 반환하고, 그렇지 않으면 오류 코드를 반환합니다.

## Remarks

하드웨어 서버와의 연결을 끊는 것 외에도, 이 호출은 [XApuConnectOutputParameters::baseData](/reference/audio/xapu/structs/xapuconnectoutputparameters)를 해제하고 [XApuConnectOutputParameters::resultReadyEvent](/reference/audio/xapu/structs/xapuconnectoutputparameters) 핸들을 닫습니다.

큐에 있는 모든 명령이 처리되기 전에 [XApuDisconnect](/reference/audio/xapu/functions/xapudisconnect)가 호출되면 모든 리소스를 해제하고 이 오류 코드 [XAPU\_E\_PENDING\_RESULTS](/reference/audio/xapu/enums/xapuerrors)를 반환합니다.

호출자는 [XApuDisconnect](/reference/audio/xapu/functions/xapudisconnect)를 호출하기 전에 큐에 있는 마지막 명령의 결과를 기다려야 합니다. 그렇지 않으면 하드웨어에서 심각한 오류가 발생하여 다른 활성 XAPU 클라이언트가 비활성화될 수 있습니다.

스트림을 시작하고 중지하기 위해 [XapuConnect](/reference/audio/xapu/functions/xapuconnect) 및 [XApuDisconnect](/reference/audio/xapu/functions/xapudisconnect)를 자주 호출하는 것은 권장되지 않습니다. 이러한 호출은 시간이 많이 걸리고 메모리 단편화로 인한 리소스 손실을 초래할 수도 있기 때문입니다. 대신 스트리밍 세션 초기화 시 [XapuConnect](/reference/audio/xapu/functions/xapuconnect)를 한 번 호출한 다음, 스트리밍 중에 스트림을 시작하고 중지하기 위해 [XApuCommandType::Activate](/reference/audio/xapu/enums/xapucommandtype) 및 [XApuCommandType::Deactivate](/reference/audio/xapu/enums/xapucommandtype)를 사용해야 합니다. 스트리밍 세션이 끝나면 [XApuDisconnect](/reference/audio/xapu/functions/xapudisconnect)를 호출해야 합니다. 이는 모든 XAPU 클라이언트에 적용됩니다.

## Requirements

**Header:** xapu.h

**Library:** xapu.lib

**Supported platforms:** XBOX Series X|S

## Conceptual documentation

* [XAPU 개요](/build/console-features/audio/overviews/xapu-overview)

## See also

[XApuConnect](/reference/audio/xapu/functions/xapudisconnect)\
[XAPU](/reference/audio/xapu/xapu_members)


## Related topics

- [XApuConnect](/ko/reference/audio/xapu/functions/xapuconnect.md)
- [XApuConnectOutputParameters](/ko/reference/audio/xapu/structs/xapuconnectoutputparameters.md)
- [XAPU API를 사용한 싱글 스트림 Opus 오디오 디코딩](/ko/build/console-features/audio/overviews/xapu-overview-single-stream-audio-decode.md)
- [XAPU](/ko/reference/audio/xapu/xapu_members.md)
- [XAPU 개요](/ko/build/console-features/audio/overviews/xapu-overview.md)
