libobs: Fix releasing filters on source destroy
I was iterating through the obs_source::filters array to remove filters, but every time I removed a filter, it would remove itself from the array, therefore it would end up skipping items in the array, therefore leaving filters unreleased. This just removes the first filter until all filters have been removed.
This commit is contained in:
parent
95a5e8009f
commit
8e5a0970b1
@ -249,8 +249,8 @@ void obs_source_destroy(struct obs_source *source)
|
||||
if (source->filter_parent)
|
||||
obs_source_filter_remove(source->filter_parent, source);
|
||||
|
||||
for (i = 0; i < source->filters.num; i++)
|
||||
obs_source_release(source->filters.array[i]);
|
||||
while (source->filters.num)
|
||||
obs_source_filter_remove(source, source->filters.array[0]);
|
||||
|
||||
for (i = 0; i < source->async_cache.num; i++)
|
||||
obs_source_frame_destroy(source->async_cache.array[i].frame);
|
||||
|
Loading…
x
Reference in New Issue
Block a user