Skip to content

Commit

Permalink
manager: do not update state if savevm fails
Browse files Browse the repository at this point in the history
Also reset viewState.suspended if VM launch fails.
Fixes #164
  • Loading branch information
osy committed Mar 24, 2020
1 parent c7ddf50 commit 146f18b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Managers/UTMVirtualMachine.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ - (BOOL)saveUTMWithError:(NSError * _Nullable *)err {

- (void)errorTriggered:(nullable NSString *)msg {
self.viewState.suspended = NO;
[self saveViewState];
[self quitVM];
self.delegate.vmMessage = msg;
[self changeState:kVMError];
Expand Down Expand Up @@ -396,10 +397,10 @@ - (BOOL)saveVM {
success = NO;
} else {
NSLog(@"Save completed");
self.viewState.suspended = YES;
[self saveViewState];
[self saveScreenshot];
}
self.viewState.suspended = YES;
[self saveViewState];
[self saveScreenshot];
[self changeState:state];
_is_busy = NO;
return success;
Expand Down

0 comments on commit 146f18b

Please sign in to comment.