When Sound blocks are loaded, they can have packedfiles. If a Sound isn't
played (= packedfiles opened and copied to another block) these packed data blocks where not freed. The error showed in console at closing of Blender, like: read_struct len: 24 0x1c4423c
This commit is contained in:
@@ -28,11 +28,14 @@ ListBase _samples = {0,0}, *samples = &_samples;
|
||||
|
||||
void sound_free_sound(bSound *sound)
|
||||
{
|
||||
/* this crashes blender, PLEASE fix! */
|
||||
// still crashes :(
|
||||
//if (sound) {
|
||||
// sound_set_sample(sound, NULL);
|
||||
//}
|
||||
/* when sounds have been loaded, but not played, the packedfile was not copied
|
||||
to sample block and not freed otherwise */
|
||||
if(sound->sample==NULL) {
|
||||
if (sound->newpackedfile) {
|
||||
freePackedFile(sound->newpackedfile);
|
||||
sound->newpackedfile = NULL;
|
||||
}
|
||||
}
|
||||
if (sound->stream) MEM_freeN(sound->stream);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user