mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
audio: Fixed adding new physical devices to a double-linked list.
(Forgot to hook up existing node's `prev` field when adding the new device to the head of the list. Doh.)
This commit is contained in:
parent
db39cbf208
commit
cdd2ba81de
1 changed files with 5 additions and 0 deletions
|
|
@ -246,6 +246,11 @@ static SDL_AudioDevice *CreatePhysicalAudioDevice(const char *name, SDL_bool isc
|
|||
device->instance_id = assign_audio_device_instance_id(iscapture, /*islogical=*/SDL_FALSE);
|
||||
|
||||
SDL_LockRWLockForWriting(current_audio.device_list_lock);
|
||||
|
||||
if (*devices) {
|
||||
SDL_assert((*devices)->prev == NULL);
|
||||
(*devices)->prev = device;
|
||||
}
|
||||
device->next = *devices;
|
||||
*devices = device;
|
||||
SDL_AtomicIncRef(device_count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue