diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-09-18 17:05:16 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-09-18 17:16:03 +0300 |
commit | f84448d4a0019375cf01e52f3320846a98e8f2e8 (patch) | |
tree | 52fab4d39869aa4a5106f00d56cc586cbf83a989 /source/blender/blenkernel/intern/sound.c | |
parent | 533ec46efbc533383f80052f8c5057db5ec1348b (diff) |
Fix T52813: Audaspace: Leak when loading factory settings
Patch by Joerg Mueller (neXyon) with some touchups by me.
Diffstat (limited to 'source/blender/blenkernel/intern/sound.c')
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 94fa81308fe..a2568707b0a 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -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; |