fixing addref/release errors in SelectAll code - fixes bug #2166

git-svn-id: svn://10.0.0.236/trunk@17984 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jfrancis%netscape.com
1999-01-19 01:54:57 +00:00
parent 372fb40b32
commit 10747a8399
2 changed files with 8 additions and 6 deletions

View File

@@ -1698,7 +1698,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
body = child;
break;
}
NS_IF_RELEASE(atom);
}
NS_RELEASE(child);
}
@@ -1709,6 +1709,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
start = body;
// Find Very first Piece of Content
NS_ADDREF(start); //to balance release below
for (;;) {
start->ChildCount(n);
if (n <= 0) {
@@ -1720,6 +1721,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
}
end = body;
NS_ADDREF(end); //to balance release below
// Last piece of Content
for (;;) {
end->ChildCount(n);
@@ -1731,8 +1733,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
NS_RELEASE(child);
}
//NS_RELEASE(start);
//NS_RELEASE(end);
NS_RELEASE(body);
SetDisplaySelection(PR_TRUE);
return NS_OK;

View File

@@ -1698,7 +1698,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
body = child;
break;
}
NS_IF_RELEASE(atom);
}
NS_RELEASE(child);
}
@@ -1709,6 +1709,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
start = body;
// Find Very first Piece of Content
NS_ADDREF(start); //to balance release below
for (;;) {
start->ChildCount(n);
if (n <= 0) {
@@ -1720,6 +1721,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
}
end = body;
NS_ADDREF(end); //to balance release below
// Last piece of Content
for (;;) {
end->ChildCount(n);
@@ -1731,8 +1733,7 @@ NS_IMETHODIMP nsDocument::SelectAll() {
NS_RELEASE(child);
}
//NS_RELEASE(start);
//NS_RELEASE(end);
NS_RELEASE(body);
SetDisplaySelection(PR_TRUE);
return NS_OK;