diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index c5b1ee31dfec2eb9cf7e4812ee297c00d4ec38a7..21bd0d9f8b9176dea4ebfe235007018303579c4c 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2012-08-03 Adam Barth + + WebCore::DragController::cleanupAfterSystemDrag should null-check page + https://bugs.webkit.org/show_bug.cgi?id=61815 + + Reviewed by Eric Seidel. + + * page/DragController.cpp: + (WebCore::DragController::dragEnteredOrUpdated): + (WebCore::DragController::doSystemDrag): + 2012-08-03 Sergio Carlos Morales Angeles Delete text from password does nothing. diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp index 1ac1ed3387735866133e5026f190e89d8ddf9052..b8205751b4472fc3b7fc93ddd8d7ffa23a90c8bc 100644 --- a/Source/WebCore/page/DragController.cpp +++ b/Source/WebCore/page/DragController.cpp @@ -254,7 +254,7 @@ void DragController::mouseMovedIntoDocument(Document* newDocument) DragSession DragController::dragEnteredOrUpdated(DragData* dragData) { ASSERT(dragData); - ASSERT(m_page->mainFrame()); // It is not possible in Mac WebKit to have a Page without a mainFrame() + ASSERT(m_page->mainFrame()); mouseMovedIntoDocument(m_page->mainFrame()->documentAtPoint(dragData->clientPosition())); m_dragDestinationAction = m_client->actionMaskForDrag(dragData); @@ -892,6 +892,9 @@ void DragController::doSystemDrag(DragImageRef image, const IntPoint& dragLoc, c RefPtr viewProtector = frameProtector->view(); m_client->startDrag(image, viewProtector->rootViewToContents(frame->view()->contentsToRootView(dragLoc)), viewProtector->rootViewToContents(frame->view()->contentsToRootView(eventPos)), clipboard, frameProtector.get(), forLink); + // DragClient::startDrag can cause our Page to dispear, deallocating |this|. + if (!frameProtector->page()) + return; cleanupAfterSystemDrag(); }