Follow-up to my earlier fix for r147085
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 05:39:55 +0000 (05:39 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Jul 2015 05:39:55 +0000 (05:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147085

Reviewed by Eric Carlson.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::isPlayingAudioDidChange):
Null-check document() before dereferencing it in case the audio context's document is destroyed
by the time the code block is called on the main thread.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioContext.cpp

index 6d52315..3f682c0 100644 (file)
@@ -1,3 +1,15 @@
+2015-07-20  Ada Chan  <adachan@apple.com>
+
+        Follow-up to my earlier fix for r147085
+        https://bugs.webkit.org/show_bug.cgi?id=147085
+
+        Reviewed by Eric Carlson.
+
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::isPlayingAudioDidChange):
+        Null-check document() before dereferencing it in case the audio context's document is destroyed
+        by the time the code block is called on the main thread.
+
 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Remove RenderTheme::shouldShowPlaceholderWhenFocused()
index 63b2501..2fc6389 100644 (file)
@@ -1073,7 +1073,8 @@ void AudioContext::isPlayingAudioDidChange()
     // we could be on the audio I/O thread here and the call into WebCore could block.
     RefPtr<AudioContext> strongThis(this);
     callOnMainThread([strongThis] {
-        strongThis->document()->updateIsPlayingMedia();
+        if (strongThis->document())
+            strongThis->document()->updateIsPlayingMedia();
     });
 }