fix leaks.
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::setWebView):
only change webview if its different
* WebCoreSupport/WebFrameBridge.m:
(-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]):
actually use the client allocated in the line above instead of
allocation again, duh.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17191
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-21 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Maciej.
+
+ fix leaks.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (WebEditorClient::setWebView):
+ only change webview if its different
+
+ * WebCoreSupport/WebFrameBridge.m:
+ (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]):
+ actually use the client allocated in the line above instead of
+ allocation again, duh.
+
2006-10-21 Alice Liu <alice.liu@apple.com>
Build fix.
void WebEditorClient::setWebView(WebView* webView)
{
- [m_webView release];
- m_webView = webView;
- [m_webView retain];
+ if (m_webView != webView) {
+ [m_webView release];
+ m_webView = webView;
+ [m_webView retain];
+ }
}
bool WebEditorClient::shouldDeleteRange(Range *range)
- (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement frameName:(NSString *)name view:(WebFrameView *)view
{
WebEditorClient* editorClient = new WebEditorClient();
- self = [super initSubframeWithOwnerElement:ownerElement withEditorClient:new WebEditorClient()];
+ self = [super initSubframeWithOwnerElement:ownerElement withEditorClient:editorClient];
_frame = [[WebFrame alloc] _initWithWebFrameView:view webView:[self webView] bridge:self];
editorClient->setWebView([self webView]);
- editorClient->deref();
++WebBridgeCount;
[self setName:name];