From d7630243847b6cff2475ed9a0387568061085132 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 7 Feb 2013 06:05:24 -0500 Subject: [PATCH] bug 838570 - selection code can sometimes leak a range r=smaug --- layout/generic/nsSelection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 40c1b5f81d0c..bcb320765b52 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -3402,7 +3402,7 @@ Selection::SubtractRange(RangeData* aRange, nsRange* aSubtract, if (cmp2 > 0) { // We need to add a new RangeData to the output, running from // the end of aSubtract to the end of range - nsRange* postOverlap = new nsRange(); + nsRefPtr postOverlap = new nsRange(); rv = postOverlap->SetStart(aSubtract->GetEndParent(), aSubtract->EndOffset()); @@ -3420,7 +3420,7 @@ Selection::SubtractRange(RangeData* aRange, nsRange* aSubtract, if (cmp < 0) { // We need to add a new RangeData to the output, running from // the start of the range to the start of aSubtract - nsRange* preOverlap = new nsRange(); + nsRefPtr preOverlap = new nsRange(); nsresult rv = preOverlap->SetStart(range->GetStartParent(), range->StartOffset());