LibMedia: Don't keep PlaybackStreamPulseAudio alive in its thread
As soon as the promise is resolved, we need to unref it, so move it to the deferred_invoke() callback. This allows PulseAudio streams to be released properly and gives TestPlaybackStream a chance to pass instead of timing out.
This commit is contained in:
parent
c77eae4a55
commit
f1c05aefde
1 changed files with 2 additions and 2 deletions
|
|
@ -59,8 +59,8 @@ NonnullRefPtr<PlaybackStream::CreatePromise> PlaybackStreamPulseAudio::create(Ou
|
|||
auto event_loop = main_thread_event_loop->take();
|
||||
if (!event_loop)
|
||||
return 1;
|
||||
event_loop->deferred_invoke([promise = move(promise), playback_stream] {
|
||||
promise->resolve(playback_stream);
|
||||
event_loop->deferred_invoke([promise = move(promise), playback_stream = move(playback_stream)] mutable {
|
||||
promise->resolve(move(playback_stream));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue