mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +00:00
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.
This commit is contained in:
parent
457fda6354
commit
9d0b56b1fc
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue