Commit b706da23 authored by timothy@apple.com's avatar timothy@apple.com

Fixes a crash seen in Xcode where CallUIDelegateReturningBoolean

was referencing a nil WebView under validateUserInterfaceItem.
The validateUserInterfaceItem methods was being called at a time
when the WebHTMLView is being torndown.

<rdar://problem/5806229> A crash occurs at CallUIDelegateReturningBoolean()
while mousing down on menu bar after Xcode News window is opened

Reviewed by Ada Chan.

* WebView/WebHTMLView.mm:
(-[WebHTMLView validateUserInterfaceItem:]): NULL check the WebView and
return NO when it is nil. Adds a comment.
* WebView/WebPDFView.mm:
(-[WebPDFView validateUserInterfaceItem:]): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a5d0af3b
2008-05-13 Timothy Hatcher <timothy@apple.com>
Fixes a crash seen in Xcode where CallUIDelegateReturningBoolean
was referencing a nil WebView under validateUserInterfaceItem.
The validateUserInterfaceItem methods was being called at a time
when the WebHTMLView is being torndown.
<rdar://problem/5806229> A crash occurs at CallUIDelegateReturningBoolean()
while mousing down on menu bar after Xcode News window is opened
Reviewed by Ada Chan.
* WebView/WebHTMLView.mm:
(-[WebHTMLView validateUserInterfaceItem:]): NULL check the WebView and
return NO when it is nil. Adds a comment.
* WebView/WebPDFView.mm:
(-[WebPDFView validateUserInterfaceItem:]): Ditto.
2008-05-13 Mark Rowe <mrowe@apple.com>
Reviewed by John Sullivan.
......
......@@ -2416,6 +2416,10 @@ WEBCORE_COMMAND(yankAndSelect)
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
// This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean
// assumes the WebVIew is non-nil.
if (![self _webView])
return NO;
BOOL result = [self validateUserInterfaceItemWithoutDelegate:item];
return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result);
}
......
......@@ -491,6 +491,10 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
// This can be called during teardown when _webView is nil. Return NO when this happens, because CallUIDelegateReturningBoolean
// assumes the WebVIew is non-nil.
if (![self _webView])
return NO;
BOOL result = [self validateUserInterfaceItemWithoutDelegate:item];
return CallUIDelegateReturningBoolean(result, [self _webView], @selector(webView:validateUserInterfaceItem:defaultValidation:), item, result);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment