From ef4a4e4872e05722d367b6fc769c48852aabbba2 Mon Sep 17 00:00:00 2001 From: "nisheeth%netscape.com" Date: Mon, 22 Nov 1999 00:01:18 +0000 Subject: [PATCH] Fix for bug 17937. nsHTMLEditor::DeleteSelectionAndCreateNode() wasn't addref'ing an out parameter. r=sfraser. --- editor/base/nsHTMLEditor.cpp | 1 + editor/libeditor/html/nsHTMLEditor.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/editor/base/nsHTMLEditor.cpp b/editor/base/nsHTMLEditor.cpp index 4ab818ef514..7cebf591aed 100644 --- a/editor/base/nsHTMLEditor.cpp +++ b/editor/base/nsHTMLEditor.cpp @@ -1634,6 +1634,7 @@ nsHTMLEditor::DeleteSelectionAndCreateNode(const nsString& aTag, getter_AddRefs(newNode)); // XXX: ERROR_HANDLING check result, and make sure aNewNode is set correctly in success/failure cases *aNewNode = newNode; + NS_IF_ADDREF(*aNewNode); // we want the selection to be just after the new node nsCOMPtr selection; diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index 4ab818ef514..7cebf591aed 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -1634,6 +1634,7 @@ nsHTMLEditor::DeleteSelectionAndCreateNode(const nsString& aTag, getter_AddRefs(newNode)); // XXX: ERROR_HANDLING check result, and make sure aNewNode is set correctly in success/failure cases *aNewNode = newNode; + NS_IF_ADDREF(*aNewNode); // we want the selection to be just after the new node nsCOMPtr selection;