fix crash when reboot is pressed more than once

This commit is contained in:
elijahr2411
2023-02-07 14:09:30 -05:00
parent b46ee1360b
commit 63b641ec58

View File

@@ -154,7 +154,10 @@ export default class QEMUVM extends EventEmitter {
}
Reboot() : Promise<void> {
return this.qmpClient.reboot();
return new Promise(async (res, rej) => {
if (this.expectedExit) {res(); return;}
res(await this.qmpClient.reboot());
});
}
async Restore() {