diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2022-11-10 21:03:36 +0100 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-11-12 10:04:21 -0700 |
commit | 9d0b56b1fc8add68a4005c7be2bccf8621909990 (patch) | |
tree | 36f7a02189c2cfee16293d0aea14c4684a390038 /Userland/Libraries/LibAudio | |
parent | 457fda635414ab7a041f33cf5f3c6cf013822a3a (diff) | |
download | serenity-9d0b56b1fc8add68a4005c7be2bccf8621909990.zip |
LibAudio: Initialize enqueuer event loop to null pointer
If this is not done, the event loop pointer will be initialized to
exploded MALLOC_SCRUB_BYTEs and the null pointer check at destruction
time will fail, causing a crash any time an audio client without a
started enqueuer thread exits. With this change, we correctly skip
quitting the event loop both when it was never started (if the enqueuer
thread never ran) as well as if it already exited (if the enqueuer
thread exited fast enough) without additional logic for the two very
different cases.
Diffstat (limited to 'Userland/Libraries/LibAudio')
-rw-r--r-- | Userland/Libraries/LibAudio/ConnectionToServer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibAudio/ConnectionToServer.h b/Userland/Libraries/LibAudio/ConnectionToServer.h index 7abd516aa5..ca840d90a2 100644 --- a/Userland/Libraries/LibAudio/ConnectionToServer.h +++ b/Userland/Libraries/LibAudio/ConnectionToServer.h @@ -81,7 +81,7 @@ private: NonnullOwnPtr<UserSampleQueue> m_user_queue; NonnullRefPtr<Threading::Thread> m_background_audio_enqueuer; - Core::EventLoop* m_enqueuer_loop; + Core::EventLoop* m_enqueuer_loop { nullptr }; Threading::Mutex m_enqueuer_loop_destruction; // A good amount of time to sleep when the queue is full. |