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