mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibMedia: Ensure that the PulseAudioContext atexit() call succeeds
This commit is contained in:
parent
ee3c080fb5
commit
7811c2e71b
Notes:
github-actions[bot]
2025-09-04 17:39:13 +00:00
Author: https://github.com/Zaggy1024
Commit: 7811c2e71b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6076
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 1 deletions
|
|
@ -23,10 +23,13 @@ ErrorOr<NonnullRefPtr<PulseAudioContext>> PulseAudioContext::instance()
|
|||
static Threading::Mutex instantiation_mutex;
|
||||
// Lock and unlock the mutex to ensure that the mutex is fully unlocked at application
|
||||
// exit.
|
||||
atexit([]() {
|
||||
auto atexit_result = atexit([]() {
|
||||
instantiation_mutex.lock();
|
||||
instantiation_mutex.unlock();
|
||||
});
|
||||
if (atexit_result) {
|
||||
return Error::from_string_literal("Unable to set PulseAudioContext atexit action");
|
||||
}
|
||||
|
||||
auto instantiation_locker = Threading::MutexLocker(instantiation_mutex);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue