From da3df8bc188ede5f3ff24cf9ac46ae18967b6838 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 1 Jun 2012 18:43:15 +0000 Subject: [PATCH] Merge revision 663 changes: - Mac: Delay destroying the browser window until pending drag operations have completed (issue #610). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/963@664 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser_webview_delegate_mac.mm | 7 +++++++ 1 file changed, 7 insertions(+) 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() {