Skip to content

Commit bd03a71

Browse files
committed
[1.10>master] [MERGE #5537 @dilijev] OS#18178361: Don't call JavascriptWeakMap::Clear on shutdown since ScriptContext may have already been freed.
Merge pull request #5537 from dilijev:weakmap-clear
2 parents 371bd81 + 7c4a6ea commit bd03a71

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Runtime/Library/JavascriptWeakMap.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ namespace Js
7777
bool Has(RecyclableObject* key) const;
7878
void Set(RecyclableObject* key, Var value);
7979

80-
virtual void Finalize(bool isShutdown) override { Clear(); }
80+
virtual void Finalize(bool isShutdown) override
81+
{
82+
if (!isShutdown)
83+
{
84+
Clear();
85+
}
86+
}
87+
8188
virtual void Dispose(bool isShutdown) override { }
8289

8390
virtual BOOL GetDiagTypeString(StringBuilder<ArenaAllocator>* stringBuilder, ScriptContext* requestContext) override;

0 commit comments

Comments
 (0)