Fix #114342: Crash when opening too many movies at once
Adding strips or changing filepaths caused thatde movie files were loaded, but memory was only released after new frame was rendered. Since FFmpeg can take a lot of memory per strip, this can cause crash. Free memory for each strip immediately after it is not needed after these operations. Pull Request: https://projects.blender.org/blender/blender/pulls/114381
This commit is contained in:
committed by
Richard Antalik
parent
937b12e983
commit
5d765a0d31
@@ -511,6 +511,8 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
|
||||
seq_add_set_name(scene, seq, load_data);
|
||||
seq_add_generic_update(scene, seq);
|
||||
|
||||
/* Prevent high memory usage when adding many files at once. */
|
||||
SEQ_relations_sequence_free_anim(seq);
|
||||
MEM_freeN(anim_arr);
|
||||
return seq;
|
||||
}
|
||||
@@ -626,6 +628,9 @@ void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const boo
|
||||
if (seq->len < 0) {
|
||||
seq->len = 0;
|
||||
}
|
||||
|
||||
/* Prevent high memory usage when reloading many files at once. */
|
||||
SEQ_relations_sequence_free_anim(seq);
|
||||
break;
|
||||
}
|
||||
case SEQ_TYPE_MOVIECLIP:
|
||||
|
||||
Reference in New Issue
Block a user