浏览代码

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