Changeset 247185 in webkit
- Timestamp:
- Jul 5, 2019 4:34:49 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247180 r247185 1 2019-07-05 Dean Jackson <dino@apple.com> 2 3 [iOS] Context Menu - Add to Reading List does nothing 4 https://bugs.webkit.org/show_bug.cgi?id=199504 5 <rdar://problem/52554137> 6 7 Reviewed by Anders Carlsson. 8 9 We were holding weak references to the _WKElementAction in 10 the handler provided to UIAction. By the time the handler was 11 called, the object had been deallocated. 12 13 * UIProcess/API/Cocoa/_WKElementAction.mm: 14 (-[_WKElementAction uiActionForElementInfo:]): Use strong references in handler. 15 1 16 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm
r246867 r247185 30 30 31 31 #import "GestureTypes.h" 32 #import "Logging.h" 32 33 #import "WKActionSheetAssistant.h" 33 34 #import "WKContentViewInteraction.h" … … 285 286 UIActionIdentifier identifier = elementActionTypeToUIActionIdentifier(self.type); 286 287 287 return [UIAction actionWithTitle:self.title image:image identifier:identifier handler:[weakSelf = WeakObjCPtr<_WKElementAction>(self), weakElementInfo = WeakObjCPtr<_WKActivatedElementInfo>(elementInfo)] (UIAction *) { 288 auto strongSelf = weakSelf.get(); 289 if (!strongSelf) 290 return; 291 auto strongElementInfo = weakElementInfo.get(); 292 if (!strongElementInfo) 293 return; 294 [strongSelf runActionWithElementInfo:strongElementInfo.get()]; 288 return [UIAction actionWithTitle:self.title image:image identifier:identifier handler:[retainedSelf = retainPtr(self), retainedInfo = retainPtr(elementInfo)] (UIAction *) { 289 auto elementAction = retainedSelf.get(); 290 RELEASE_LOG(ContextMenu, "Executing action for type: %s", elementActionTypeToUIActionIdentifier([elementAction type]).UTF8String); 291 [elementAction runActionWithElementInfo:retainedInfo.get()]; 295 292 }]; 296 293 }
Note: See TracChangeset
for help on using the changeset viewer.