Commit c5562238 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

WebAudio: Fix PannerNode listener removal

This was introduced in https://crrev.com/635139 where the responsibility
of liveness management was moved to PannerNode from PannerHandler.

Since CrossThreadWeakPersistent is cleared before executing the
destructor of the Handler we need to check whether the AudioListener
died in the same GC cycle.

Bug: 935854
Change-Id: Ifaa0880c356a4a7b09726a9ddf5b700a65de93bc
Reviewed-on: https://chromium-review.googlesource.com/c/1488912Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635567}
parent ea4b26bc
...@@ -277,7 +277,11 @@ void PannerHandler::Uninitialize() { ...@@ -277,7 +277,11 @@ void PannerHandler::Uninitialize() {
return; return;
panner_.reset(); panner_.reset();
Listener()->RemovePanner(*this); if (Listener()) {
// Listener may have gone in the same garbage collection cycle, which means
// that the panner does not need to be removed.
Listener()->RemovePanner(*this);
}
AudioHandler::Uninitialize(); AudioHandler::Uninitialize();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment