From d74f27f56a85a15a68ac95e596f19c3b58ad1199 Mon Sep 17 00:00:00 2001 From: Lei Shi Date: Fri, 24 Mar 2017 11:35:41 -0700 Subject: [PATCH] clear expirableObjectDisposeList at the end of disposal all objects currently removing one by one from this linked list is slow, might cause hang remove an uncessary Assert (expirableObjectDisposeList is not null as long as recycler is not null) --- lib/Runtime/Base/ThreadContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Runtime/Base/ThreadContext.cpp b/lib/Runtime/Base/ThreadContext.cpp index 17dc770748d..5d6943d9d69 100644 --- a/lib/Runtime/Base/ThreadContext.cpp +++ b/lib/Runtime/Base/ThreadContext.cpp @@ -1838,6 +1838,7 @@ void ThreadContext::DisposeOnLeaveScript() if (this->callDispose && this->recycler->NeedDispose()) { this->recycler->FinishDisposeObjectsNow(); + this->expirableObjectDisposeList->Clear(); } } @@ -3017,10 +3018,9 @@ ThreadContext::UnregisterExpirableObject(ExpirableObject* object) void ThreadContext::DisposeExpirableObject(ExpirableObject* object) { - Assert(this->expirableObjectDisposeList); Assert(object->registrationHandle == nullptr); - this->expirableObjectDisposeList->Remove(object); + //expirableObjectDisposeList will be cleared after finished disposing all objects OUTPUT_VERBOSE_TRACE(Js::ExpirableCollectPhase, _u("Disposed 0x%p\n"), object); }