Fix memory leak with IME on macOS (see http://crbug.com/654695)
This commit is contained in:
parent
18763fde50
commit
607d420baf
|
@ -81,6 +81,12 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
|
|||
return validAttributesForMarkedText_;
|
||||
}
|
||||
|
||||
- (NSRange)selectedRange {
|
||||
if (selectedRange_.location == NSNotFound || selectedRange_.length == 0)
|
||||
return NSMakeRange(NSNotFound, 0);
|
||||
return selectedRange_;
|
||||
}
|
||||
|
||||
- (NSRange)markedRange {
|
||||
return hasMarkedText_ ? markedRange_ : NSMakeRange(NSNotFound, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue