Bug 324982, remove unnecessary unregister call.

This commit is contained in:
brettw%gmail.com 2006-01-27 22:56:29 +00:00
Родитель f315db15e8
Коммит c9a66175ed
1 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -1483,10 +1483,16 @@ nsNavHistoryQueryResultNode::CanExpand()
// nsNavHistoryQueryResultNode::OnRemoving
//
// Here we do not want to call ContainerResultNode::OnRemoving since our own
// ClearChildren will do the same thing and more (unregister the observers).
// The base ResultNode::OnRemoving will clear some regular node stats, so it
// is OK.
void
nsNavHistoryQueryResultNode::OnRemoving()
{
nsNavHistoryResultNode::OnRemoving();
ClearChildren(PR_TRUE);
}
@ -1701,13 +1707,13 @@ nsNavHistoryQueryResultNode::ClearChildren(PRBool aUnregister)
for (PRInt32 i = 0; i < mChildren.Count(); i ++)
mChildren[i]->OnRemoving();
mChildren.Clear();
mContentsValid = PR_FALSE;
if (aUnregister) {
if (aUnregister && mContentsValid) {
nsNavHistoryResult* result = GetResult();
if (result)
result->RemoveEverythingObserver(this);
}
mContentsValid = PR_FALSE;
}
@ -2348,10 +2354,16 @@ nsNavHistoryFolderResultNode::nsNavHistoryFolderResultNode(
// nsNavHistoryFolderResultNode::OnRemoving
//
// Here we do not want to call ContainerResultNode::OnRemoving since our own
// ClearChildren will do the same thing and more (unregister the observers).
// The base ResultNode::OnRemoving will clear some regular node stats, so it
// is OK.
void
nsNavHistoryFolderResultNode::OnRemoving()
{
nsNavHistoryResultNode::OnRemoving();
ClearChildren(PR_TRUE);
}
@ -2522,13 +2534,13 @@ nsNavHistoryFolderResultNode::ClearChildren(PRBool unregister)
for (PRInt32 i = 0; i < mChildren.Count(); i ++)
mChildren[i]->OnRemoving();
mChildren.Clear();
mContentsValid = PR_FALSE;
if (unregister) {
if (unregister && mContentsValid) {
nsNavHistoryResult* result = GetResult();
if (result)
result->RemoveBookmarkObserver(this, mFolderId);
}
mContentsValid = PR_FALSE;
}