зеркало из https://github.com/mozilla/pjs.git
Bug 580151 - Part 2: Make sure that we decrement the counter even if creating a selection state or saving it fails; r=roc
--HG-- extra : rebase_source : 1e3d9fe47c083b8614b8a4c2937578bb1bcbfcfb
This commit is contained in:
Родитель
d030becab3
Коммит
1f46e678f4
|
@ -861,11 +861,12 @@ nsEditor::BeginPlaceHolderTransaction(nsIAtom *aName)
|
|||
mPlaceHolderName = aName;
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
nsresult res = GetSelection(getter_AddRefs(selection));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
mSelState = new nsSelectionState();
|
||||
NS_ENSURE_TRUE(mSelState, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
mSelState->SaveSelection(selection);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
mSelState = new nsSelectionState();
|
||||
if (mSelState) {
|
||||
mSelState->SaveSelection(selection);
|
||||
}
|
||||
}
|
||||
}
|
||||
mPlaceHolderBatch++;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче