Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #945 MLT::Chain leaking memory #947

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/framework/mlt_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ void mlt_chain_close(mlt_chain self)
for (i = 0; i < base->link_count; i++)
mlt_link_close(base->links[i]);
free(base->links);
mlt_producer_close(base->source);
ddennedy marked this conversation as resolved.
Show resolved Hide resolved
mlt_properties_close(base->source_parameters);
mlt_profile_close(base->source_profile);
free(base);
self->parent.close = NULL;
Expand Down
1 change: 1 addition & 0 deletions src/modules/core/producer_melt.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ mlt_producer producer_melt_init(mlt_profile profile,
}
if (producer != NULL && chain != NULL) {
mlt_chain_set_source(chain, producer);
mlt_producer_close(producer);
mlt_chain_attach_normalizers(chain);
producer = MLT_CHAIN_PRODUCER(chain);
} else if (producer != NULL) {
Expand Down
1 change: 1 addition & 0 deletions src/modules/xml/producer_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ static void on_end_chain(deserialise_context context, const xmlChar *name)
mlt_properties_inherit(MLT_PRODUCER_PROPERTIES(source), properties);
// Add the source producer to the chain
mlt_chain_set_source(chain, source);
mlt_producer_close(source);
mlt_chain_attach_normalizers(chain);

// See if the chain should be added to a playlist or multitrack
Expand Down
Loading