File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ struct VMWizardOSMacView: View {
5858 wizardState. busyWorkAsync {
5959 #if arch(arm64)
6060 let url = try result. get ( )
61+ let scopedAccess = url. startAccessingSecurityScopedResource ( )
62+ defer {
63+ if scopedAccess {
64+ url. stopAccessingSecurityScopedResource ( )
65+ }
66+ }
6167 let image = try await VZMacOSRestoreImage . image ( from: url)
6268 guard let model = image. mostFeaturefulSupportedConfiguration? . hardwareModel else {
6369 throw NSLocalizedString ( " Your machine does not support running this IPSW. " , comment: " VMWizardOSMacView " )
Original file line number Diff line number Diff line change @@ -136,6 +136,12 @@ struct VMConfigAppleBootView: View {
136136 case . ipsw:
137137 if #available( macOS 12 , * ) {
138138 #if arch(arm64)
139+ let scopedAccess = url. startAccessingSecurityScopedResource ( )
140+ defer {
141+ if scopedAccess {
142+ url. stopAccessingSecurityScopedResource ( )
143+ }
144+ }
139145 let image = try await VZMacOSRestoreImage . image ( from: url)
140146 guard let model = image. mostFeaturefulSupportedConfiguration? . hardwareModel else {
141147 throw NSLocalizedString ( " Your machine does not support running this IPSW. " , comment: " VMConfigAppleBootView " )
You can’t perform that action at this time.
0 commit comments