Skip to content

Commit 7c4a6ea

Browse files
committed
[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 ac99d70 + 238025e commit 7c4a6ea

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
@@ -70,7 +70,14 @@ namespace Js
7070
bool Has(RecyclableObject* key) const;
7171
void Set(RecyclableObject* key, Var value);
7272

73-
virtual void Finalize(bool isShutdown) override { Clear(); }
73+
virtual void Finalize(bool isShutdown) override
74+
{
75+
if (!isShutdown)
76+
{
77+
Clear();
78+
}
79+
}
80+
7481
virtual void Dispose(bool isShutdown) override { }
7582

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

0 commit comments

Comments
 (0)