Bug 270571 - [Modern Media Controls] HTMLMediaElement is never destroyed when showing media controls
Summary: [Modern Media Controls] HTMLMediaElement is never destroyed when showing medi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrique Ocaña
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-03-06 05:49 PST by Enrique Ocaña
Modified: 2024-04-08 06:46 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enrique Ocaña 2024-03-06 05:49:30 PST
At least in GStreamer-based ports (WPE and WebKitGTK, I haven't checked on Mac ports because I don't have the proper environment easily available), the media element is leaked after explicit deinitialization and detaching from the HTML document, even after manually triggering garbage collection using the web inspector.

For more details and a test case, see: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/1285

After some debugging, we've detected that 2 extra references to HTMLMediaElement appear when using the controls (3 refs in total), while in a scenario where the controls are hidden on purpose only 1 reference remains, which is released as soon as the GC kicks in.
Comment 1 Enrique Ocaña 2024-03-08 04:46:41 PST
Pull request: https://github.com/WebKit/WebKit/pull/25625
Comment 2 Radar WebKit Bug Importer 2024-03-13 06:50:14 PDT
<rdar://problem/124527802>
Comment 3 Enrique Ocaña 2024-04-03 11:41:25 PDT
Pull request: https://github.com/WebKit/WebKit/pull/26798
Comment 4 EWS 2024-04-08 06:46:09 PDT
Committed 277196@main (80dd62a7e332): <https://commits.webkit.org/277196@main>

Reviewed commits have been landed. Closing PR #26798 and removing active labels.