зеркало из https://github.com/mozilla/pjs.git
Bug 6665. Hack to addref resources before doing the sort. This saves mailnews from having to recreate them.
This commit is contained in:
Родитель
912dc7a410
Коммит
8a37a5afc1
|
@ -1032,6 +1032,17 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, PRInt32 colIndex, so
|
||||||
inplaceSortCallback, (void *)sortInfo);
|
inplaceSortCallback, (void *)sortInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug 6665. This is a hack to "addref" the resources
|
||||||
|
// before we remove them from the content model. This
|
||||||
|
// keeps them from getting released, which causes
|
||||||
|
// performance problems for some datasources.
|
||||||
|
for (loop = 0; loop < numElements; loop++)
|
||||||
|
{
|
||||||
|
nsIRDFResource* resource;
|
||||||
|
nsRDFContentUtils::GetElementResource(flatArray[loop], &resource);
|
||||||
|
// Note that we don't release; see part deux below...
|
||||||
|
}
|
||||||
|
|
||||||
RemoveAllChildren(container);
|
RemoveAllChildren(container);
|
||||||
if (NS_FAILED(rv = container->UnsetAttribute(kNameSpaceID_None,
|
if (NS_FAILED(rv = container->UnsetAttribute(kNameSpaceID_None,
|
||||||
kTreeContentsGeneratedAtom,
|
kTreeContentsGeneratedAtom,
|
||||||
|
@ -1047,6 +1058,16 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, PRInt32 colIndex, so
|
||||||
container->InsertChildAt((nsIContent *)flatArray[loop], numChildren++, PR_FALSE);
|
container->InsertChildAt((nsIContent *)flatArray[loop], numChildren++, PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug 6665, part deux. The Big Hack.
|
||||||
|
for (loop = 0; loop < numElements; loop++)
|
||||||
|
{
|
||||||
|
nsIRDFResource* resource;
|
||||||
|
nsRDFContentUtils::GetElementResource(flatArray[loop], &resource);
|
||||||
|
nsrefcnt refcnt;
|
||||||
|
NS_RELEASE2(resource, refcnt);
|
||||||
|
NS_RELEASE(resource);
|
||||||
|
}
|
||||||
|
|
||||||
// recurse on grandchildren
|
// recurse on grandchildren
|
||||||
for (loop=0; loop<numElements; loop++)
|
for (loop=0; loop<numElements; loop++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1032,6 +1032,17 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, PRInt32 colIndex, so
|
||||||
inplaceSortCallback, (void *)sortInfo);
|
inplaceSortCallback, (void *)sortInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug 6665. This is a hack to "addref" the resources
|
||||||
|
// before we remove them from the content model. This
|
||||||
|
// keeps them from getting released, which causes
|
||||||
|
// performance problems for some datasources.
|
||||||
|
for (loop = 0; loop < numElements; loop++)
|
||||||
|
{
|
||||||
|
nsIRDFResource* resource;
|
||||||
|
nsRDFContentUtils::GetElementResource(flatArray[loop], &resource);
|
||||||
|
// Note that we don't release; see part deux below...
|
||||||
|
}
|
||||||
|
|
||||||
RemoveAllChildren(container);
|
RemoveAllChildren(container);
|
||||||
if (NS_FAILED(rv = container->UnsetAttribute(kNameSpaceID_None,
|
if (NS_FAILED(rv = container->UnsetAttribute(kNameSpaceID_None,
|
||||||
kTreeContentsGeneratedAtom,
|
kTreeContentsGeneratedAtom,
|
||||||
|
@ -1047,6 +1058,16 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, PRInt32 colIndex, so
|
||||||
container->InsertChildAt((nsIContent *)flatArray[loop], numChildren++, PR_FALSE);
|
container->InsertChildAt((nsIContent *)flatArray[loop], numChildren++, PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bug 6665, part deux. The Big Hack.
|
||||||
|
for (loop = 0; loop < numElements; loop++)
|
||||||
|
{
|
||||||
|
nsIRDFResource* resource;
|
||||||
|
nsRDFContentUtils::GetElementResource(flatArray[loop], &resource);
|
||||||
|
nsrefcnt refcnt;
|
||||||
|
NS_RELEASE2(resource, refcnt);
|
||||||
|
NS_RELEASE(resource);
|
||||||
|
}
|
||||||
|
|
||||||
// recurse on grandchildren
|
// recurse on grandchildren
|
||||||
for (loop=0; loop<numElements; loop++)
|
for (loop=0; loop<numElements; loop++)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче