OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 20:31:04 +0000 (20:31 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 20:31:04 +0000 (20:31 +0000)
commit77b25dd0bd524fc6ca0e6fa91fc45d246c513bd7
tree537458dbe6937dfbb296dbad30e91edd7915fcce
parent1aaaa8039aaf6dbd8f7090aaa83908a7eba074eb
OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
https://bugs.webkit.org/show_bug.cgi?id=196759

Reviewed by Eric Carlson.

OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().

Also removed the debug assertion in offlineRender which always hits when we run the relevant test.

Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html

* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
(WebCore::OfflineAudioDestinationNode::offlineRender):
(WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
* Modules/webaudio/OfflineAudioDestinationNode.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h