diff --git a/libcef/browser_webview_delegate_mac.mm b/libcef/browser_webview_delegate_mac.mm index f11a66773..6619da1fd 100644 --- a/libcef/browser_webview_delegate_mac.mm +++ b/libcef/browser_webview_delegate_mac.mm @@ -399,10 +399,17 @@ void BrowserWebViewDelegate::startDragging(const WebDragData& data, ns_image = gfx::SkBitmapToNSImageWithColorSpace(bitmap, color_space); } NSPoint offset = NSPointFromCGPoint(gfx::Point(image_offset).ToCGPoint()); + + // Keep a reference to the NSView so that it won't be destroyed until after + // the drag operation has completed. + [view retain]; + [view startDragWithDropData:drop_data dragOperationMask:static_cast(mask) image:ns_image offset:offset]; + + [view release]; } void BrowserWebViewDelegate::runModal() {