Skip to content

Commit

Permalink
vm(apple): fix crash when changing shared directory
Browse files Browse the repository at this point in the history
Fixes #4271
  • Loading branch information
osy committed Aug 7, 2022
1 parent c692698 commit 558aae5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Managers/UTMAppleVirtualMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ import Virtualization
try await _vmStart()
if #available(macOS 12, *) {
sharedDirectoriesChanged = appleConfig.$sharedDirectories.sink { [weak self] newShares in
self?.updateSharedDirectories(with: newShares)
guard let self = self else {
return
}
self.vmQueue.async {
self.updateSharedDirectories(with: newShares)
}
}
}
changeState(.vmStarted)
Expand Down

0 comments on commit 558aae5

Please sign in to comment.