Remove "Add to iPhoto" from the action menu's sharing menu
[WebKit-https.git] / Source / WebKit2 / UIProcess / mac / WKActionMenuController.mm
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