Skip to content

Commit 6d416a1

Browse files
committed
fix: memory leak on saving code cache
1 parent ea4cefa commit 6d416a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test-app/runtime/src/main/cpp/ModuleInternal.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ void ModuleInternal::SaveScriptCache(const Local<Script> script, const std::stri
507507
int length = cachedData->length;
508508
auto cachePath = path + ".cache";
509509
File::WriteBinary(cachePath, cachedData->data, length);
510+
delete cachedData;
510511
}
511512

512513
ModuleInternal::ModulePathKind ModuleInternal::GetModulePathKind(const std::string& path) {

0 commit comments

Comments
 (0)