Clear animation list to avoid referencing freed memory.

This commit is contained in:
Antony Riakiotakis
2015-05-19 16:15:38 +02:00
parent df0a1fa3c5
commit 158c891520

View File

@@ -254,15 +254,15 @@ void BKE_sequence_free_anim(Sequence *seq)
{ {
while (seq->anims.last) { while (seq->anims.last) {
StripAnim *sanim = seq->anims.last; StripAnim *sanim = seq->anims.last;
BLI_remlink(&seq->anims, sanim);
if (sanim->anim) { if (sanim->anim) {
IMB_free_anim(sanim->anim); IMB_free_anim(sanim->anim);
sanim->anim = NULL; sanim->anim = NULL;
} }
MEM_freeN(sanim); BLI_freelinkN(&seq->anims, sanim);
} }
BLI_listbase_clear(&seq->anims);
} }
/* cache must be freed before calling this function /* cache must be freed before calling this function