Reviewed by Richard.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 May 2004 07:17:03 +0000 (07:17 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 May 2004 07:17:03 +0000 (07:17 +0000)
<rdar://problem/3652498>: new sniffing support is crashing

* WebView.subproj/WebMainResourceClient.m:
        (-[WebMainResourceClient checkContentPolicyForResponse:]): Retain
listener around call, in case delegate does something that ends up
invalidating it, like navigating to a new URL.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebView.subproj/WebMainResourceClient.m
WebKit/WebView.subproj/WebMainResourceLoader.m

index d938693..1614481 100644 (file)
@@ -1,3 +1,14 @@
+2004-05-25  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Richard.
+
+       <rdar://problem/3652498>: new sniffing support is crashing
+        
+       * WebView.subproj/WebMainResourceClient.m:
+        (-[WebMainResourceClient checkContentPolicyForResponse:]): Retain
+       listener around call, in case delegate does something that ends up
+       invalidating it, like navigating to a new URL.
+
 2004-05-25  Chris Blumenberg  <cblu@apple.com>
 
        Fixed regression where undoing typing would undo character-by-character.
index 3ae9c0a..93b95ef 100644 (file)
 
 -(void)checkContentPolicyForResponse:(NSURLResponse *)r
 {
-    listener = [[WebPolicyDecisionListener alloc]
-                  _initWithTarget:self action:@selector(continueAfterContentPolicy:)];
+    WebPolicyDecisionListener *l = [[WebPolicyDecisionListener alloc]
+                                      _initWithTarget:self action:@selector(continueAfterContentPolicy:)];
+    listener = l;
     policyResponse = [r retain];
 
     WebView *wv = [dataSource _webView];
     [wv setDefersCallbacks:YES];
+    [l retain];
     [[wv _policyDelegateForwarder] webView:wv decidePolicyForMIMEType:[r MIMEType]
                                                             request:[dataSource request]
                                                               frame:[dataSource webFrame]
                                                    decisionListener:listener];
+    [l release];
 }
 
 
index 3ae9c0a..93b95ef 100644 (file)
 
 -(void)checkContentPolicyForResponse:(NSURLResponse *)r
 {
-    listener = [[WebPolicyDecisionListener alloc]
-                  _initWithTarget:self action:@selector(continueAfterContentPolicy:)];
+    WebPolicyDecisionListener *l = [[WebPolicyDecisionListener alloc]
+                                      _initWithTarget:self action:@selector(continueAfterContentPolicy:)];
+    listener = l;
     policyResponse = [r retain];
 
     WebView *wv = [dataSource _webView];
     [wv setDefersCallbacks:YES];
+    [l retain];
     [[wv _policyDelegateForwarder] webView:wv decidePolicyForMIMEType:[r MIMEType]
                                                             request:[dataSource request]
                                                               frame:[dataSource webFrame]
                                                    decisionListener:listener];
+    [l release];
 }