chore: separate kill subprocess and dispose functions
This commit is contained in:
parent
fd512f2cee
commit
d0e484a663
@ -13,7 +13,7 @@ const dispose = async () =>
|
||||
new Promise(async (resolve) => {
|
||||
if (window.electronAPI) {
|
||||
window.electronAPI
|
||||
.invokePluginFunc(MODULE_PATH, "killSubprocess")
|
||||
.invokePluginFunc(MODULE_PATH, "dispose")
|
||||
.then((res) => resolve(res));
|
||||
}
|
||||
});
|
||||
|
||||
@ -72,6 +72,11 @@ async function initModel(product) {
|
||||
}
|
||||
|
||||
function dispose() {
|
||||
killSubprocess();
|
||||
// clean other registered resources here
|
||||
}
|
||||
|
||||
function killSubprocess() {
|
||||
if (subprocess) {
|
||||
subprocess.kill();
|
||||
subprocess = null;
|
||||
@ -83,5 +88,6 @@ function dispose() {
|
||||
|
||||
module.exports = {
|
||||
initModel,
|
||||
killSubprocess,
|
||||
dispose,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user