File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ struct VMWizardOSMacView: View {
58
58
wizardState. busyWorkAsync {
59
59
#if arch(arm64)
60
60
let url = try result. get ( )
61
+ let scopedAccess = url. startAccessingSecurityScopedResource ( )
62
+ defer {
63
+ if scopedAccess {
64
+ url. stopAccessingSecurityScopedResource ( )
65
+ }
66
+ }
61
67
let image = try await VZMacOSRestoreImage . image ( from: url)
62
68
guard let model = image. mostFeaturefulSupportedConfiguration? . hardwareModel else {
63
69
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 {
136
136
case . ipsw:
137
137
if #available( macOS 12 , * ) {
138
138
#if arch(arm64)
139
+ let scopedAccess = url. startAccessingSecurityScopedResource ( )
140
+ defer {
141
+ if scopedAccess {
142
+ url. stopAccessingSecurityScopedResource ( )
143
+ }
144
+ }
139
145
let image = try await VZMacOSRestoreImage . image ( from: url)
140
146
guard let model = image. mostFeaturefulSupportedConfiguration? . hardwareModel else {
141
147
throw NSLocalizedString ( " Your machine does not support running this IPSW. " , comment: " VMConfigAppleBootView " )
You can’t perform that action at this time.
0 commit comments