fix: avoid contextBridge double free on garbage collection (#21592)
* fix: reset next/prev pointers for life-monitored nodes * fix: don't double-delete nodes in a linked list
This commit is contained in:
parent
2858471151
commit
301bd8aec0
1 changed files with 3 additions and 5 deletions
|
@ -47,9 +47,11 @@ class CachedProxyLifeMonitor final : public ObjectLifeMonitor {
|
||||||
}
|
}
|
||||||
if (node_->prev) {
|
if (node_->prev) {
|
||||||
node_->prev->next = node_->next;
|
node_->prev->next = node_->next;
|
||||||
|
node_->prev = nullptr;
|
||||||
}
|
}
|
||||||
if (node_->next) {
|
if (node_->next) {
|
||||||
node_->next->prev = node_->prev;
|
node_->next->prev = node_->prev;
|
||||||
|
node_->next = nullptr;
|
||||||
}
|
}
|
||||||
if (!node_->prev && !node_->next) {
|
if (!node_->prev && !node_->next) {
|
||||||
// Must be a single length linked list
|
// Must be a single length linked list
|
||||||
|
@ -76,11 +78,7 @@ WeakGlobalPairNode::WeakGlobalPairNode(WeakGlobalPair pair) {
|
||||||
this->pair = std::move(pair);
|
this->pair = std::move(pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
WeakGlobalPairNode::~WeakGlobalPairNode() {
|
WeakGlobalPairNode::~WeakGlobalPairNode() {}
|
||||||
if (next) {
|
|
||||||
delete next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderFramePersistenceStore::RenderFramePersistenceStore(
|
RenderFramePersistenceStore::RenderFramePersistenceStore(
|
||||||
content::RenderFrame* render_frame)
|
content::RenderFrame* render_frame)
|
||||||
|
|
Loading…
Reference in a new issue