Skip to content

Commit c40f086

Browse files
committed
[1.4>master] [MERGE #2345 @pleath] Fix leak in deferred function dictionary.
Merge pull request #2345 from pleath:deferreddictionary Now that the deferred function dictionary is leaf memory, we need to remove ParseableFunctionInfo's from it as they are undeferred.
2 parents 4b0f782 + 5d9e5a9 commit c40f086

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/Runtime/Base/FunctionBody.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,6 +2145,7 @@ namespace Js
21452145
// - This is an already parsed asm.js module, which has been invalidated at link time and must be reparsed as a non-asm.js function
21462146
if (!this->m_hasBeenParsed)
21472147
{
2148+
this->GetUtf8SourceInfo()->StopTrackingDeferredFunction(this->GetLocalFunctionId());
21482149
funcBody = FunctionBody::NewFromParseableFunctionInfo(this);
21492150
autoRestoreFunctionInfo.funcBody = funcBody;
21502151

lib/Runtime/ByteCode/ByteCodeGenerator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,7 @@ FuncInfo * ByteCodeGenerator::StartBindFunction(const char16 *name, uint nameLen
12821282
{
12831283
if (!reuseNestedFunc->IsFunctionBody())
12841284
{
1285+
reuseNestedFunc->GetUtf8SourceInfo()->StopTrackingDeferredFunction(reuseNestedFunc->GetLocalFunctionId());
12851286
Js::FunctionBody * parsedFunctionBody =
12861287
Js::FunctionBody::NewFromParseableFunctionInfo(reuseNestedFunc->GetParseableFunctionInfo());
12871288
autoRestoreFunctionInfo.funcBody = parsedFunctionBody;

0 commit comments

Comments
 (0)