Title: [97808] trunk/Source/WebKit2
Revision
97808
Author
[email protected]
Date
2011-10-18 16:17:26 -0700 (Tue, 18 Oct 2011)

Log Message

Crash in WebProcess at com.apple.AppKit: -[NSFilePromiseDragSource draggedImage:endedAt:operation:] + 101
https://bugs.webkit.org/show_bug.cgi?id=70340
<rdar://problem/9548174>
                
We have seen a number of crash reports for this issue that seem to occurr when
the user drags an image from a web page onto the desktop.
We have not been able to reproduce this crash, therefore this is a speculative fix,
but the theory is that the dragging source has been already released when draggedImage
is called.
This patch attempts a fix for the problem by retaining the dragging source when
NSFilePromiseDragSource is created.

Reviewed by Darin Adler.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(-[WKPasteboardFilePromiseOwner initWithSource:]):
(-[WKPasteboardFilePromiseOwner dealloc]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (97807 => 97808)


--- trunk/Source/WebKit2/ChangeLog	2011-10-18 23:14:48 UTC (rev 97807)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-18 23:17:26 UTC (rev 97808)
@@ -1,3 +1,23 @@
+2011-10-18  Enrica Casucci  <[email protected]>
+
+        Crash in WebProcess at com.apple.AppKit: -[NSFilePromiseDragSource draggedImage:endedAt:operation:] + 101
+        https://bugs.webkit.org/show_bug.cgi?id=70340
+        <rdar://problem/9548174>
+                
+        We have seen a number of crash reports for this issue that seem to occurr when
+        the user drags an image from a web page onto the desktop.
+        We have not been able to reproduce this crash, therefore this is a speculative fix,
+        but the theory is that the dragging source has been already released when draggedImage
+        is called.
+        This patch attempts a fix for the problem by retaining the dragging source when
+        NSFilePromiseDragSource is created.
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (-[WKPasteboardFilePromiseOwner initWithSource:]):
+        (-[WKPasteboardFilePromiseOwner dealloc]):
+
 2011-10-18  Alexey Proskuryakov  <[email protected]>
 
         [WK2] Crash after storing credentials in Keychain

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (97807 => 97808)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2011-10-18 23:14:48 UTC (rev 97807)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2011-10-18 23:17:26 UTC (rev 97808)
@@ -58,6 +58,7 @@
 // Create it explicitly because dragImage is called in the UI process.
 @interface NSFilePromiseDragSource : NSObject
 {
+    id _dragSource;
     char _unknownFields[256];
 }
 - (id)initWithSource:(id)dragSource;
@@ -189,6 +190,21 @@
 
 @implementation WKPasteboardFilePromiseOwner
 
+- (id)initWithSource:(id)dragSource
+{
+    self = [super initWithSource:dragSource];
+    if (!self)
+        return nil;
+    [_dragSource retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [_dragSource release];
+    [super dealloc];
+}
+
 // The AppKit implementation of copyDropDirectory gets the current pasteboard in
 // a way that only works in the process where the drag is initiated. We supply
 // an implementation that gets the pasteboard by name instead.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to