@xmov/avatar 2.4.0-beta.1 → 2.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmov/avatar",
3
- "version": "2.4.0-beta.1",
3
+ "version": "2.4.0-beta.2",
4
4
  "description": "魔珐数字人 JS-SDK",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",
package/src/index.ts CHANGED
@@ -1472,22 +1472,23 @@ export default class XmovAvatar {
1472
1472
  try {
1473
1473
  if (this._isClientMode) {
1474
1474
  this._apiForwarder?.destroy(stopReason);
1475
- } else if (!this.ttsa?.hasConnected) {
1476
- // Initialization can own a session/request before TTSA first connects.
1477
- // Mark an in-flight connection as quitting before waiting for DELETE.
1478
- await this.ttsa?.quit(stopReason);
1479
- await this.resourceManager.stopSession(stopReason);
1480
1475
  } else {
1481
- this.ttsa.sendSdkPoint('close_session', {
1482
- reason: stopReason,
1483
- });
1484
- await this.ttsa.quit(stopReason);
1476
+ if (this.ttsa?.hasConnected) {
1477
+ this.ttsa.sendSdkPoint('close_session', { reason: stopReason });
1478
+ }
1479
+ await this.ttsa?.quit(stopReason);
1485
1480
  }
1486
1481
  } catch (error) {
1487
1482
  (window as any).avatarSDKLogger.warn(this.TAG, "TTSA client_quit 未确认,继续释放本地资源", error);
1488
1483
  } finally {
1489
- await this.destroyClient();
1490
- this.onStatusChange(AvatarStatus.close);
1484
+ try {
1485
+ if (!this._isClientMode) {
1486
+ await this.resourceManager.stopSession(stopReason);
1487
+ }
1488
+ } finally {
1489
+ await this.destroyClient();
1490
+ this.onStatusChange(AvatarStatus.close);
1491
+ }
1491
1492
  }
1492
1493
  }
1493
1494