Skip to content

Commit

Permalink
RUN-2365: Leak SVGImage::agent_group_scheduler_ (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii committed Jul 31, 2023
1 parent c3e656e commit 0b0d38f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions third_party/blink/renderer/core/svg/graphics/svg_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ SVGImage::~SVGImage() {
if (frame_client_)
frame_client_->ClearImage();

// Leak the agent_group_scheduler_ when removed during GC.
// See https://linear.app/replay/issue/RUN-2056#comment-f827701f.
if (recordreplay::AreEventsDisallowed("~SVGImage"))
agent_group_scheduler_.release();

if (page_) {
// It is safe to allow UA events within this scope, because event
// dispatching inside the SVG image's document doesn't trigger JavaScript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ void AgentGroupSchedulerImpl::RemoveAgent(Agent* agent) {
}

void AgentGroupSchedulerImpl::PerformMicrotaskCheckpoint() {
recordreplay::Assert(
"[RUN-2056-2298] AgentGroupSchedulerImpl::PerformMicrotaskCheckpoint "
"Start %d %d",
RecordReplayId(), (int)agents_->size());

for (Agent* agent : *agents_) {
recordreplay::Assert(
"[RUN-2056-2365] AgentGroupSchedulerImpl::PerformMicrotaskCheckpoint "
"%d %d %d",
RecordReplayId(), (int)agents_->size(), agent->RecordReplayId());
agent->PerformMicrotaskCheckpoint();
}

Expand Down

0 comments on commit 0b0d38f

Please sign in to comment.