Changeset 252729 in webkit
- Timestamp:
- Nov 20, 2019, 11:25:43 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
editing/cocoa/DictionaryLookup.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252726 r252729 1 2019-11-20 Conrad Shultz <conrad_shultz@apple.com> 2 3 Crash at com.apple.WebCore: -[WebRevealHighlight revealContext:drawRectsForItem:] 4 https://bugs.webkit.org/show_bug.cgi?id=204434 5 6 Reviewed by Megan Gardner. 7 8 _attributedString was not retained, leading to a potential use-after-dealloc. Fix 9 this by wrapping it in a RetainPtr. While we're here, remove explicit ivars and 10 property synthesis and copy the string during assignment. 11 12 Reveal functionality is currently not testable. 13 14 * editing/cocoa/DictionaryLookup.mm: 15 (SOFT_LINK_CLASS_OPTIONAL): 16 (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]): 17 1 18 2019-11-20 Fujii Hironori <Hironori.Fujii@sony.com> 2 19 -
trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm
r247915 r252729 80 80 @private 81 81 Function<void()> _clearTextIndicator; 82 NSRect _highlightRect;83 BOOL _useDefaultHighlight;84 NSAttributedString *_attributedString;85 82 } 86 83 87 84 @property (nonatomic, readonly) NSRect highlightRect; 88 85 @property (nonatomic, readonly) BOOL useDefaultHighlight; 89 @property (nonatomic, readonly) NSAttributedString *attributedString;86 @property (nonatomic, readonly) RetainPtr<NSAttributedString> attributedString; 90 87 91 88 - (instancetype)initWithHighlightRect:(NSRect)highlightRect useDefaultHighlight:(BOOL)useDefaultHighlight attributedString:(NSAttributedString *) attributedString; … … 96 93 @implementation WebRevealHighlight 97 94 98 @synthesize highlightRect=_highlightRect;99 @synthesize useDefaultHighlight=_useDefaultHighlight;100 @synthesize attributedString=_attributedString;101 102 95 - (instancetype)initWithHighlightRect:(NSRect)highlightRect useDefaultHighlight:(BOOL)useDefaultHighlight attributedString:(NSAttributedString *) attributedString 103 96 { … … 107 100 _highlightRect = highlightRect; 108 101 _useDefaultHighlight = useDefaultHighlight; 109 _attributedString = a ttributedString;102 _attributedString = adoptNS([attributedString copy]); 110 103 111 104 return self;
Note:
See TracChangeset
for help on using the changeset viewer.