[webkit-changes] [WebKit/WebKit] f562da: Forbid escaping new ref's from Document::removedLa...
geoffreygaren
noreply at github.com
Fri Jan 31 10:44:30 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f562da2163b0e4f44dfb0515c7a66b113fbbbbe7
https://github.com/WebKit/WebKit/commit/f562da2163b0e4f44dfb0515c7a66b113fbbbbe7
Author: Geoffrey Garen <ggaren at apple.com>
Date: 2025-01-31 (Fri, 31 Jan 2025)
Changed paths:
M Source/WebCore/animation/AnimationTimelinesController.cpp
M Source/WebCore/dom/Document.cpp
Log Message:
-----------
Forbid escaping new ref's from Document::removedLastRef()
https://bugs.webkit.org/show_bug.cgi?id=286783
rdar://143927375
Reviewed by Ryosuke Niwa.
One case needed fixup.
This is a nice way to simplify lifetime and avoid leaks or wasted work.
* Source/WebCore/animation/AnimationTimelinesController.cpp:
(WebCore::AnimationTimelinesController::cacheCurrentTime): Capture WeakPtr to
avoid breaking the new rule.
(WebCore::AnimationTimelinesController::detachFromDocument): Make sure to remove
items from our map as we go; detachFromDocument() does not guarantee removal,
and we can get stuck in an infinite loop.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::removedLastRef): The new rule.
Canonical link: https://commits.webkit.org/289616@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list