fix: NSWindow crash happening on macos 10.9 (#15660)
This commit is contained in:
		
					parent
					
						
							
								5994bf6745
							
						
					
				
			
			
				commit
				
					
						025aa49f67
					
				
			
		
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -517,6 +517,11 @@ void NativeWindowMac::Close() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NativeWindowMac::CloseImmediately() {
 | 
					void NativeWindowMac::CloseImmediately() {
 | 
				
			||||||
 | 
					  // Retain the child window before closing it. If the last reference to the
 | 
				
			||||||
 | 
					  // NSWindow goes away inside -[NSWindow close], then bad stuff can happen.
 | 
				
			||||||
 | 
					  // See e.g. http://crbug.com/616701.
 | 
				
			||||||
 | 
					  base::scoped_nsobject<NSWindow> child_window(window_,
 | 
				
			||||||
 | 
					                                               base::scoped_policy::RETAIN);
 | 
				
			||||||
  [window_ close];
 | 
					  [window_ close];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue