Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: fxjs/cfxjse_isolatetracker.cpp

Issue 2254123004: Fix leaked array buffer allocators of isolates (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fxjs/cfxjse_isolatetracker.h ('k') | fxjs/cfxjse_runtimedata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/cfxjse_isolatetracker.cpp
diff --git a/fxjs/cfxjse_isolatetracker.cpp b/fxjs/cfxjse_isolatetracker.cpp
index 9594df310915db8bcf19bb818a21ae0fc94e9e14..adf6f2a92ecdb22479e9e22dc87e876ada59f2b5 100644
--- a/fxjs/cfxjse_isolatetracker.cpp
+++ b/fxjs/cfxjse_isolatetracker.cpp
@@ -12,8 +12,11 @@ CFXJSE_IsolateTracker::CFXJSE_IsolateTracker() {}
CFXJSE_IsolateTracker::~CFXJSE_IsolateTracker() {}
-void CFXJSE_IsolateTracker::Append(v8::Isolate* pIsolate) {
+void CFXJSE_IsolateTracker::Append(
+ v8::Isolate* pIsolate,
+ std::unique_ptr<v8::ArrayBuffer::Allocator> alloc) {
m_OwnedIsolates.push_back(pIsolate);
+ m_AllocatorMap[pIsolate] = std::move(alloc);
}
void CFXJSE_IsolateTracker::Remove(
@@ -24,6 +27,8 @@ void CFXJSE_IsolateTracker::Remove(
if (bFound)
m_OwnedIsolates.erase(it);
lpfnDisposeCallback(pIsolate, bFound);
+
+ m_AllocatorMap.erase(pIsolate);
}
void CFXJSE_IsolateTracker::RemoveAll(
@@ -32,4 +37,5 @@ void CFXJSE_IsolateTracker::RemoveAll(
lpfnDisposeCallback(pIsolate, true);
m_OwnedIsolates.clear();
+ m_AllocatorMap.clear();
}
« no previous file with comments | « fxjs/cfxjse_isolatetracker.h ('k') | fxjs/cfxjse_runtimedata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698