Don't store or use a widget in the delayed caret data; it's not important, and it might have been destroyed. b=307989 r+sr=roc
git-svn-id: svn://10.0.0.236/trunk@186150 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1697,14 +1697,22 @@ NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
|
||||
|
||||
if (NS_SUCCEEDED(result) && !mouseDown && me && me->clickCount < 2)
|
||||
{
|
||||
// We are doing this to simulate what we would have done on HandlePress
|
||||
// We are doing this to simulate what we would have done on HandlePress.
|
||||
// We didn't do it there to give the user an opportunity to drag
|
||||
// the text, but since they didn't drag, we want to place the
|
||||
// caret.
|
||||
// However, we'll use the mouse position from the release, since:
|
||||
// * it's easier
|
||||
// * that's the normal click position to use (although really, in
|
||||
// the normal case, small movements that don't count as a drag
|
||||
// can do selection)
|
||||
result = frameselection->SetMouseDownState( PR_TRUE );
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
PRInt32 startOffset = 0, endOffset = 0;
|
||||
PRBool beginFrameContent = PR_FALSE;
|
||||
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(me, this);
|
||||
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
|
||||
result = GetContentAndOffsetsFromPoint(aPresContext, pt,
|
||||
getter_AddRefs(content),
|
||||
startOffset, endOffset,
|
||||
|
||||
@@ -4183,10 +4183,8 @@ nsSelection::SetDelayedCaretData(nsMouseEvent *aMouseEvent)
|
||||
mDelayedMouseEventValid = PR_TRUE;
|
||||
mDelayedMouseEvent = *aMouseEvent;
|
||||
|
||||
// XXX: Hmmm, should we AddRef mDelayedMouseEvent->widget?
|
||||
// Doing so might introduce a leak if things in the app
|
||||
// are not released in the correct order though, so for now
|
||||
// don't do anything.
|
||||
// Don't cache the widget. We don't need it and it could go away.
|
||||
mDelayedMouseEvent.widget = nsnull;
|
||||
}
|
||||
else
|
||||
mDelayedMouseEventValid = PR_FALSE;
|
||||
|
||||
Reference in New Issue
Block a user