+2006-08-17 Timothy Hatcher <timothy@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ <rdar://problem/4633896> -[WebView close] should clear all delegates and call setHostWindow:nil
+ <rdar://problem/4649759> Crash when selecting View Source menu using Chinese (-[WebView _close])
+
+ Check to make sure _private is not null. A WebView can be dealloced before _private is setup.
+ Set the _private->closed flag at the beginning of _close to prevent reentry.
+ Set the host window and all the delegates to nil in _close.
+
+ * WebView/WebView.m:
+ (-[WebView _close]):
+
2006-08-16 Brady Eidson <beidson@apple.com>
Reviewed by Maciej
- (void)_close
{
- if (_private->closed)
+ if (!_private || _private->closed)
return;
+ _private->closed = YES;
[self _removeFromAllWebViewsSet];
+
[self setGroupName:nil];
+ [self setHostWindow:nil];
+ [self setDownloadDelegate:nil];
+ [self setEditingDelegate:nil];
+ [self setFrameLoadDelegate:nil];
+ [self setPolicyDelegate:nil];
+ [self setResourceLoadDelegate:nil];
+ [self setScriptDebugDelegate:nil];
+ [self setUIDelegate:nil];
// To avoid leaks, call removeDragCaret in case it wasn't called after moveDragCaretToPoint.
[self removeDragCaret];
-
+
[[self mainFrame] _detachFromParent];
[_private->_pageBridge close];
[_private->_pageBridge release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[WebPreferences _removeReferenceForIdentifier: [self preferencesIdentifier]];
-
- _private->closed = YES;
}
+ (NSString *)_MIMETypeForFile:(NSString *)path