From 318c157dcaf21d84e916251010aa2868f1e2d09f Mon Sep 17 00:00:00 2001 From: Kei Kamikawa Date: Thu, 16 Sep 2021 01:07:12 +0900 Subject: [PATCH] removed autoreleasepool from newVZDiskImageStorageDeviceAttachment --- virtualization.m | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/virtualization.m b/virtualization.m index 91a9b90..2b2e2b4 100644 --- a/virtualization.m +++ b/virtualization.m @@ -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]; }