I find some memory leaks of the vsMotionDetection function:
in the vs_vector_filter, vs_vector_append should be replaced by vs_vector_append_dup, and add vs_vector_del(&motions2); behind motionsfine = vs_vector_filter(&motions2, lm_match_better, &meanMatch); in vsMotionDetection meanwhile;
Hi, thanks for grate work!
I find some memory leaks of the
vsMotionDetection
function:vs_vector_filter
,vs_vector_append
should be replaced byvs_vector_append_dup
, and addvs_vector_del(&motions2);
behindmotionsfine = vs_vector_filter(&motions2, lm_match_better, &meanMatch);
invsMotionDetection
meanwhile;vs_array_free(matchQualities1);
behinddouble meanMatch = cleanmean(matchQualities1.dat, matchQualities1.len, NULL, NULL);
invsMotionDetection
;vs_vector_fini(&motionscoarse); vs_vector_fini(&motionsfine);
behind*motions = vs_vector_concat(&motionscoarse, &motionsfine);
invsMotionDetection
.You can check the code and fix the problems. Best wishes.