From b63dfc3b9d884d4dd1f595de5a770eec9f18ff5e Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Mon, 3 Aug 1998 22:20:41 +0000 Subject: [PATCH] Added ref counting on nsIContent git-svn-id: svn://10.0.0.236/trunk@7156 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/src/nsSelectionRange.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/base/src/nsSelectionRange.cpp b/mozilla/layout/base/src/nsSelectionRange.cpp index 4133faee384..946cff65bf8 100644 --- a/mozilla/layout/base/src/nsSelectionRange.cpp +++ b/mozilla/layout/base/src/nsSelectionRange.cpp @@ -59,19 +59,27 @@ void nsSelectionRange::SetRange(nsSelectionRange * aRange) { } void nsSelectionRange::SetStartPoint(nsSelectionPoint * aPoint) { - mStart->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor()); + nsIContent * content = aPoint->GetContent(); + mStart->SetPoint(content, aPoint->GetOffset(), aPoint->IsAnchor()); + NS_IF_RELEASE(content); } void nsSelectionRange::SetEndPoint(nsSelectionPoint * aPoint) { - mEnd->SetPoint(aPoint->GetContent(), aPoint->GetOffset(), aPoint->IsAnchor()); + nsIContent * content = aPoint->GetContent(); + mEnd->SetPoint(content, aPoint->GetOffset(), aPoint->IsAnchor()); + NS_IF_RELEASE(content); } void nsSelectionRange::GetStartPoint(nsSelectionPoint * aPoint) { - aPoint->SetPoint(mStart->GetContent(), mStart->GetOffset(), mStart->IsAnchor()); + nsIContent * content = mStart->GetContent(); + aPoint->SetPoint(content, mStart->GetOffset(), mStart->IsAnchor()); + NS_IF_RELEASE(content); } void nsSelectionRange::GetEndPoint(nsSelectionPoint * aPoint) { - aPoint->SetPoint(mEnd->GetContent(), mEnd->GetOffset(), mEnd->IsAnchor()); + nsIContent * content = mEnd->GetContent(); + aPoint->SetPoint(content, mEnd->GetOffset(), mEnd->IsAnchor()); + NS_IF_RELEASE(content); } void nsSelectionRange::GetRange(nsSelectionRange * aRange) {