Bug 913130, part 3 - Run {PrepareFor,CleanupAfter} every iteration of ShutdownCollect. r=smaug

This commit is contained in:
Andrew McCreight 2013-09-06 16:17:03 -07:00
parent fe8bff9077
commit 76de7e39ff

View File

@ -2663,12 +2663,12 @@ nsCycleCollector::ShutdownCollect(nsICycleCollectorListener *aListener)
{
nsAutoTArray<PtrInfo*, 4000> whiteNodes;
if (!PrepareForCollection(nullptr, &whiteNodes))
return;
for (uint32_t i = 0; i < DEFAULT_SHUTDOWN_COLLECTIONS; ++i) {
NS_ASSERTION(i < NORMAL_SHUTDOWN_COLLECTIONS, "Extra shutdown CC");
if (!PrepareForCollection(nullptr, &whiteNodes))
return;
// Synchronous cycle collection. Always force a JS GC beforehand.
FixGrayBits(true);
@ -2678,12 +2678,12 @@ nsCycleCollector::ShutdownCollect(nsICycleCollectorListener *aListener)
aListener = nullptr;
BeginCollection(ShutdownCC, aListener);
if (!FinishCollection(aListener)) {
bool collectedAny = FinishCollection(aListener);
CleanupAfterCollection();
if (!collectedAny) {
break;
}
}
CleanupAfterCollection();
}
bool