Collapse() might have destroyed 'frame'. b=368697 r+sr=roc

This commit is contained in:
mats.palmgren%bredband.net 2007-01-30 22:28:06 +00:00
parent 095ff1061e
commit 9ea6a75e09

View File

@ -1407,8 +1407,10 @@ nsFrameSelection::MoveCaret(PRUint32 aKeycode,
// 2. had select-all in a text input (DIV range), bug 352759.
weakNodeUsed = mDomSelections[index]->FetchFocusNode();
offsetused = mDomSelections[index]->FetchFocusOffset();
PRBool isBRFrame = frame->GetType() == nsGkAtoms::brFrame;
mDomSelections[index]->Collapse(weakNodeUsed, offsetused);
if (frame->GetType() == nsGkAtoms::brFrame) {
// Note: 'frame' might be dead here.
if (isBRFrame) {
tHint = mHint; // 1: make the line below restore the original hint
}
else {