WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
314996
Avoid lazy-allocating UndoManager during Document teardown
https://bugs.webkit.org/show_bug.cgi?id=314996
Summary
Avoid lazy-allocating UndoManager during Document teardown
David Kilzer (:ddkilzer)
Reported
2026-05-17 20:26:27 PDT
`Document::willBeRemovedFromFrame()` calls `protect(undoManager())->removeAllItems()` unconditionally. `Document::undoManager()` lazy-creates the `UndoManager` through `ensureUndoManager()` when `m_undoManager` is null. For clients that do not create `m_undoManager`, every detached `Document` lazy-allocates a 32-byte `UndoManager`, calls a no-op `removeAllItems()` on its empty `HashSet`, and then destroys it in `~Document`. This is wasted work that scales with every detached `Document`.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-05-17 20:26:36 PDT
<
rdar://problem/177311258
>
David Kilzer (:ddkilzer)
Comment 2
2026-05-17 20:42:52 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/65083
EWS
Comment 3
2026-05-17 22:25:49 PDT
Committed
313393@main
(408429b44b24): <
https://commits.webkit.org/313393@main
> Reviewed commits have been landed. Closing PR #65083 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug