mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-03 12:37:36 +01:00
cefclient: macOS: Fix CefBrowser leak during OSR shutdown (issue #2151)
This commit is contained in:
parent
f2b988a0ce
commit
f440f850ef
@ -189,12 +189,19 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
|
||||
name:NSWindowDidChangeBackingPropertiesNotification
|
||||
object:nil];
|
||||
|
||||
if (text_input_context_osr_mac_) {
|
||||
[GetInputClientFromContext(text_input_context_osr_mac_) release];
|
||||
[text_input_context_osr_mac_ release];
|
||||
}
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)detach {
|
||||
renderer_ = NULL;
|
||||
browser_window_ = NULL;
|
||||
if (text_input_context_osr_mac_)
|
||||
[GetInputClientFromContext(text_input_context_osr_mac_) detach];
|
||||
}
|
||||
|
||||
- (CefRefPtr<CefBrowser>)getBrowser {
|
||||
@ -527,10 +534,11 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
|
||||
- (NSTextInputContext*)inputContext {
|
||||
if (!text_input_context_osr_mac_) {
|
||||
CefTextInputClientOSRMac* text_input_client =
|
||||
[[CefTextInputClientOSRMac alloc] initWithBrowser:[self getBrowser]];
|
||||
[[[CefTextInputClientOSRMac alloc]
|
||||
initWithBrowser:[self getBrowser]] retain];
|
||||
|
||||
text_input_context_osr_mac_ = [[NSTextInputContext alloc] initWithClient:
|
||||
text_input_client];
|
||||
text_input_context_osr_mac_ = [[[NSTextInputContext alloc] initWithClient:
|
||||
text_input_client] retain];
|
||||
}
|
||||
|
||||
return text_input_context_osr_mac_;
|
||||
|
@ -66,6 +66,7 @@
|
||||
@property(nonatomic) BOOL handlingKeyDown;
|
||||
|
||||
- (id)initWithBrowser:(CefRefPtr<CefBrowser>)browser;
|
||||
- (void)detach;
|
||||
- (void)HandleKeyEventBeforeTextInputClient:(NSEvent*)keyEvent;
|
||||
- (void)HandleKeyEventAfterTextInputClient:(CefKeyEvent)keyEvent;
|
||||
- (void)ChangeCompositionRange:(CefRange)range
|
||||
|
@ -69,6 +69,10 @@ extern NSString* NSTextInputReplacementRangeAttributeName;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)detach {
|
||||
browser_ = NULL;
|
||||
}
|
||||
|
||||
- (NSArray*)validAttributesForMarkedText {
|
||||
if (!validAttributesForMarkedText_) {
|
||||
validAttributesForMarkedText_ = [[NSArray alloc] initWithObjects:
|
||||
|
Loading…
x
Reference in New Issue
Block a user