Sound: Make sure spin lock is initialized for new sound datablocks
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 4 May 2019 18:34:56 +0000 (20:34 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 4 May 2019 18:34:56 +0000 (20:34 +0200)
Should have been done as a part of 9f681bea68f.

source/blender/blenkernel/intern/sound.c

index 7d335ab134778422fe8b3ec8ffa267661da3bc82..d731c6e3eac77bd8bc3a4b73be00841180bb0407 100644 (file)
@@ -103,6 +103,9 @@ bSound *BKE_sound_new_file(Main *bmain, const char *filepath)
   BLI_strncpy(sound->name, filepath, FILE_MAX);
   /* sound->type = SOUND_TYPE_FILE; */ /* XXX unused currently */
 
+  sound->spinlock = MEM_mallocN(sizeof(SpinLock), "sound_spinlock");
+  BLI_spin_init(sound->spinlock);
+
   BKE_sound_reset_runtime(sound);
 
   return sound;