Skip to content

Commit 60b7dbc

Browse files
authored
Merge pull request #1454 from LibertyGlobal/offline_renderer_mem_leak_fix
Fix 'offline renderer' thread cleanup
2 parents 803de0e + bc53de1 commit 60b7dbc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ void OfflineAudioDestinationNode::uninitialize()
8686
return;
8787

8888
if (m_startedRendering) {
89-
if (m_renderThread) {
90-
m_renderThread->waitForCompletion();
91-
m_renderThread = nullptr;
92-
}
9389
if (auto* workletProxy = context().audioWorklet().proxy()) {
9490
BinarySemaphore semaphore;
9591
workletProxy->postTaskForModeToWorkletGlobalScope([&semaphore](ScriptExecutionContext&) mutable {
@@ -99,6 +95,11 @@ void OfflineAudioDestinationNode::uninitialize()
9995
}
10096
}
10197

98+
if (m_renderThread) {
99+
m_renderThread->waitForCompletion();
100+
m_renderThread = nullptr;
101+
}
102+
102103
AudioNode::uninitialize();
103104
}
104105

0 commit comments

Comments
 (0)