nsSortState-allowonstack
author Benjamin Smedberg <benjamin@smedbergs.us>
Sat, 26 Jul 2008 22:49:39 -0400
changeset 167 a4da40849f5436e629c5732f4368c6c48189637f
parent 159 969d8d4050b8b7ebfb082c860b4a16df41348d52
permissions -rw-r--r--
State as of now

diff --git a/content/xul/templates/src/nsXULSortService.cpp b/content/xul/templates/src/nsXULSortService.cpp
--- a/content/xul/templates/src/nsXULSortService.cpp
+++ b/content/xul/templates/src/nsXULSortService.cpp
@@ -153,7 +153,7 @@ XULSortServiceImpl::GetItemsToSort(nsICo
     element->GetBuilder(getter_AddRefs(builder));
 
     if (builder) {
-      nsresult rv = builder->GetQueryProcessor(getter_AddRefs(aSortState->processor));
+      nsresult rv = builder->GetQueryProcessor(&aSortState->processor);
       if (NS_FAILED(rv) || !aSortState->processor)
   return rv;
 
@@ -387,7 +387,7 @@ XULSortServiceImpl::InitializeSortState(
                                         nsSortState* aSortState)
 {
   // used as an optimization for the content builder
-  if (aContainer != aSortState->lastContainer.get()) {
+  if (aContainer != aSortState->lastContainer) {
     aSortState->lastContainer = aContainer;
     aSortState->lastWasFirst = PR_FALSE;
     aSortState->lastWasLast = PR_FALSE;
diff --git a/content/xul/templates/src/nsXULSortService.h b/content/xul/templates/src/nsXULSortService.h
--- a/content/xul/templates/src/nsXULSortService.h
+++ b/content/xul/templates/src/nsXULSortService.h
@@ -84,12 +84,14 @@ struct nsSortState
   nsAutoString sort;
   nsCOMArray<nsIAtom> sortKeys;
 
-  nsCOMPtr<nsIXULTemplateQueryProcessor> processor;
-  nsCOMPtr<nsIContent> lastContainer;
+  nsIXULTemplateQueryProcessor* processor;
+  nsIContent* lastContainer;
   PRBool lastWasFirst, lastWasLast;
 
   nsSortState()
     : initialized(PR_FALSE)
+    , processor(nsnull)
+    , lastContainer(nsnull)
   {
   }
 };