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:
Casey
2026-05-06 17:21:09 +02:00
parent d6b34cec93
commit b2f4ae322d
+2
View File
@@ -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