Remove "Add to iPhoto" from the action menu's sharing menu
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Oct 2014 20:21:26 +0000 (20:21 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Oct 2014 20:21:26 +0000 (20:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138251
<rdar://problem/18837197>

Reviewed by Anders Carlsson.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
Retain/autorelease the new array.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

index c0ea1cfed04d1f6e308cf1c99cf845fd0257ef2f..f6965418591ec1f800da5ad2016edd8044f2f6eb 100644 (file)
@@ -1,3 +1,15 @@
+2014-10-31  Timothy Horton  <timothy_horton@apple.com>
+
+        Remove "Add to iPhoto" from the action menu's sharing menu
+        https://bugs.webkit.org/show_bug.cgi?id=138251
+        <rdar://problem/18837197>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/mac/WKActionMenuController.mm:
+        (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
+        Retain/autorelease the new array.
+
 2014-10-31  Tim Horton  <timothy_horton@apple.com>
 
         Remove "Add to iPhoto" from the action menu's sharing menu
index 3942a468b9530e6124636d82616da31fdadbe815..1afe366cb3ee20cf0871d85d2d97dfa8db9629dc 100644 (file)
@@ -348,7 +348,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
 
 - (NSArray *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items mask:(NSSharingServiceMask)mask proposedSharingServices:(NSArray *)proposedServices
 {
-    NSMutableArray *services = [[NSMutableArray alloc] initWithCapacity:proposedServices.count];
+    RetainPtr<NSMutableArray> services = adoptNS([[NSMutableArray alloc] initWithCapacity:proposedServices.count]);
 
     for (NSSharingService *service in proposedServices) {
         if ([service.name isEqualToString:NSSharingServiceNameAddToIPhoto])
@@ -356,7 +356,7 @@ static NSString *pathToPhotoOnDisk(NSString *suggestedFilename)
         [services addObject:service];
     }
 
-    return services;
+    return services.autorelease();
 }
 
 - (id <NSSharingServiceDelegate>)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService