Updated on 2024-07-30 GMT+08:00

Scenario 12: Exit

Description

When a third-party application exits the SDK, the SDK needs to be deinitialized. Otherwise, the HwmSdk.exe process (main process of the Electron SDK on the Windows 64-bit platform) is still running in the background. This scenario applies only to the 64-bit Windows platform.

Service Process

To exit the SDK, call the Exit synchronization API.

  1. Call an API.

    1. Call the Exit API to exit the SDK.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
/**
* Exit the SDK.
*/
async exitSdk(){
    const apiService = await new ApiService();
    let setResult = await apiService.exit();
    if(setResult != 0){
        window.electron.ipcRenderer.send("show-error-alert", "exit error = " + setResult);
    }
}
1
2
3
4
5
6
7
8
9
/**
* Definition of exit API in ApiService
*/
exit() {
  console.log("exit, in param = ");
  let ret = this.uisdkService.exit();
  console.log("exit, out data = ", ret);
  return ret;
}