Title: [88401] trunk/Source/WebKit2
Revision
88401
Author
sulli...@apple.com
Date
2011-06-08 16:02:40 -0700 (Wed, 08 Jun 2011)

Log Message

<https://bugs.webkit.org/show_bug.cgi?id=62332>
<rdar://problem/9355199>
[WKView _setDragImage:at:linkDrag:] can crash if WKView is dealloc'ed during drag

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView _resendKeyDownEvent:]):
Renamed self-protecting RetainPtr from "protect" to "protector" so it's a noun.
(-[WKView _setDragImage:at:linkDrag:]):
Added a self-protecting RetainPtr.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (88400 => 88401)


--- trunk/Source/WebKit2/ChangeLog	2011-06-08 23:00:04 UTC (rev 88400)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-08 23:02:40 UTC (rev 88401)
@@ -1,3 +1,17 @@
+2011-06-08  John Sullivan  <sulli...@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <https://bugs.webkit.org/show_bug.cgi?id=62332>
+        <rdar://problem/9355199>
+        [WKView _setDragImage:at:linkDrag:] can crash if WKView is dealloc'ed during drag
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _resendKeyDownEvent:]):
+        Renamed self-protecting RetainPtr from "protect" to "protector" so it's a noun.
+        (-[WKView _setDragImage:at:linkDrag:]):
+        Added a self-protecting RetainPtr.
+
 2011-06-08  No'am Rosenthal  <noam.rosent...@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (88400 => 88401)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-06-08 23:00:04 UTC (rev 88400)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-06-08 23:02:40 UTC (rev 88401)
@@ -2032,7 +2032,7 @@
 - (void)_resendKeyDownEvent:(NSEvent *)event
 {
     // resending the event may destroy this WKView
-    RetainPtr<WKView> protect(self);
+    RetainPtr<WKView> protector(self);
 
     ASSERT(!_data->_keyDownEventBeingResent);
     _data->_keyDownEventBeingResent = event;
@@ -2337,6 +2337,10 @@
         return;
     
     _data->_dragHasStarted = YES;
+    
+    // The call to super could release this WKView.
+    RetainPtr<WKView> protector(self);
+    
     [super dragImage:image
                   at:clientPoint
               offset:NSZeroSize
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to