Skip to content

Commit

Permalink
removed autoreleasepool from newVZDiskImageStorageDeviceAttachment
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Hex committed Sep 15, 2021
1 parent 7475877 commit 318c157
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions virtualization.m
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,12 @@ void setStorageDevicesVZVirtualMachineConfiguration(void *config,
*/
void *newVZDiskImageStorageDeviceAttachment(const char *diskPath, bool readOnly, void **error)
{
VZDiskImageStorageDeviceAttachment *ret;
@autoreleasepool {
NSString *diskPathNSString = [NSString stringWithUTF8String:diskPath];
NSURL *diskURL = [NSURL fileURLWithPath:diskPathNSString];
ret = [[VZDiskImageStorageDeviceAttachment alloc]
initWithURL:diskURL
readOnly:(BOOL)readOnly
error:(NSError * _Nullable * _Nullable)error];
}
return ret;
NSString *diskPathNSString = [NSString stringWithUTF8String:diskPath];
NSURL *diskURL = [NSURL fileURLWithPath:diskPathNSString];
return [[VZDiskImageStorageDeviceAttachment alloc]
initWithURL:diskURL
readOnly:(BOOL)readOnly
error:(NSError * _Nullable * _Nullable)error];
}


Expand Down

0 comments on commit 318c157

Please sign in to comment.