fix:高并发下,共享vad里decoder变量扰动

This commit is contained in:
hrz
2026-02-24 01:59:44 +08:00
parent 8897b4f3c6
commit fd8296262e
3 changed files with 57 additions and 28 deletions
+8
View File
@@ -1119,6 +1119,14 @@ class ConnectionHandler:
async def close(self, ws=None):
"""资源清理方法"""
try:
# 清理 VAD 连接资源
if (
hasattr(self, "vad")
and self.vad
and hasattr(self.vad, "release_conn_resources")
):
self.vad.release_conn_resources(self)
# 清理音频缓冲区
if hasattr(self, "audio_buffer"):
self.audio_buffer.clear()