mirror of
https://github.com/utmapp/UTM.git
synced 2026-10-12 02:24:01 +00:00
fix: memory leak in UTMAppleVirtualMachine when installation fails
Clear progressObserver and installProgress in the error path of installVM() to break the retain cycle caused by the KVO observation closure capturing self strongly.
This commit is contained in:
@@ -582,6 +582,8 @@ final class UTMAppleVirtualMachine: UTMVirtualMachine {
|
||||
throw UTMAppleVirtualMachineError.operatingSystemInstallNotSupported
|
||||
#endif
|
||||
} catch {
|
||||
progressObserver = nil
|
||||
installProgress = nil
|
||||
await stopAccesingResources()
|
||||
delegate?.virtualMachine(self, didCompleteInstallation: false)
|
||||
state = .stopped
|
||||
|
||||
Reference in New Issue
Block a user