소스 검색

use @autoreleasepool instead of NSAutoreleasePool

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
James Dumay 11 년 전
부모
커밋
af26945f22
1개의 변경된 파일13개의 추가작업 그리고 14개의 파일을 삭제
  1. 13 14
      Sources/VLCMedia.m

+ 13 - 14
Sources/VLCMedia.m

@@ -866,21 +866,20 @@ NSString *const VLCMediaTracksInformationTextEncoding = @"encoding"; // NSString
 #if !TARGET_OS_IPHONE
 - (void)fetchMetaInformationForArtWorkWithURL:(NSString *)anURL
 {
-    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-    NSImage * art = nil;
-
-    if (anURL) {
-        // Go ahead and load up the art work
-        NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
-        // Don't attempt to fetch artwork from remote. Core will do that alone
-        if ([artUrl isFileURL])
-            art  = [[[NSImage alloc] initWithContentsOfURL:artUrl] autorelease];
-    }
-
-    // If anything was found, lets save it to the meta data dictionary
-    [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+    @autoreleasepool {
+        NSImage * art = nil;
+
+        if (anURL) {
+            // Go ahead and load up the art work
+            NSURL * artUrl = [NSURL URLWithString:[anURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+            // Don't attempt to fetch artwork from remote. Core will do that alone
+            if ([artUrl isFileURL])
+                art  = [[NSImage alloc] initWithContentsOfURL:artUrl];
+        }
 
-    [pool release];
+        // If anything was found, lets save it to the meta data dictionary
+        [self performSelectorOnMainThread:@selector(setArtwork:) withObject:art waitUntilDone:NO];
+    }
 }
 
 - (void)setArtwork:(NSImage *)art