Fix T52813: Audaspace: Leak when loading factory settings

Patch by Joerg Mueller (neXyon) with some touchups by me.
This commit is contained in:
Dalai Felinto 2017-09-18 16:05:16 +02:00
parent 533ec46efb
commit f84448d4a0
Notes: blender-bot 2023-02-14 07:25:51 +01:00
Referenced by issue #52813, Audaspace: Leak when loading factory settings
1 changed files with 4 additions and 1 deletions

View File

@ -226,7 +226,7 @@ void BKE_sound_init_once(void)
atexit(BKE_sound_exit_once);
}
static AUD_Device *sound_device;
static AUD_Device *sound_device = NULL;
void *BKE_sound_get_device(void)
{
@ -235,6 +235,9 @@ void *BKE_sound_get_device(void)
void BKE_sound_init(struct Main *bmain)
{
/* Make sure no instance of the sound system is running, otherwise we get leaks. */
BKE_sound_exit();
AUD_DeviceSpecs specs;
int device, buffersize;
const char *device_name;