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:
Ton Roosendaal
2004-04-23 13:11:29 +00:00
parent 9095df6efb
commit da7b4711a4

View File

@@ -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);
}