mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
PlaybackManager's ref counting was only used to keep it alive in a few callbacks. Instead, the callbacks can use weak references that can only be used from the thread that the PlaybackManager was created on, to ensure that the PlaybackManager can't be destroyed while being accessed. This ensures that: - The PlaybackManager is destroyed immediately when it is reassigned by HTMLMediaElement - No callbacks are invoked after that point This fixes the crash initially being addressed by #8081. The test from that PR has been included as a regression test.
11 lines
228 B
HTML
11 lines
228 B
HTML
<!DOCTYPE html>
|
|
<video id="video"></video>
|
|
<script>
|
|
video.preload = "none";
|
|
video.src = "../../Assets/test-webm.webm";
|
|
video.onsuspend = () => {
|
|
video.onsuspend = null;
|
|
video.load();
|
|
};
|
|
</script>
|