Prevent a few memory leaks in the tests.
Also mark ges_project_save as transfer full for the formatter asset.
Also make sure that ges_project_request_sync is transfer full on the
returned asset.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/104
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
if ((asset = g_hash_table_lookup (project->priv->assets, internal_id))) {
g_free (internal_id);
- return asset;
+ return gst_object_ref (asset);
} else if (g_hash_table_lookup (project->priv->loading_assets, internal_id) ||
g_hash_table_lookup (project->priv->loaded_with_error, internal_id)) {
g_free (internal_id);
* @project: A #GESProject to save
* @timeline: The #GESTimeline to save, it must have been extracted from @project
* @uri: The uri where to save @project and @timeline
- * @formatter_asset: (allow-none): The formatter asset to use or %NULL. If %NULL,
- * will try to save in the same format as the one from which the timeline as been loaded
- * or default to the best formatter as defined in #ges_find_formatter_for_uri
+ * @formatter_asset: (transfer full) (allow-none): The formatter asset to
+ * use or %NULL. If %NULL, will try to save in the same format as the one
+ * from which the timeline as been loaded or default to the best formatter
+ * as defined in #ges_find_formatter_for_uri
* @overwrite: %TRUE to overwrite file if it exists
* @error: (out) (allow-none): An error to be set in case something wrong happens or %NULL
*
g_free (uri);
g_free (uri1);
+ gst_object_unref (asset1);
+ gst_object_unref (asset);
+
ges_deinit ();
}
gap_object_check (gap, 0, 10, 1);
fail_unless (ges_timeline_commit (timeline));
+ gst_object_unref (asset);
gst_object_unref (timeline);
}
assert_num_in_track (video_track, 3);
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
ges_clip_get_top_effect_index (clip, GES_BASE_EFFECT (effect2)));
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
g_free (tmpuri);
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
free_children_properties (child_props2, num_props2);
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
g_list_free_full (objects, gst_object_unref);
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
ASSERT_OBJECT_REFCOUNT (transition, "layer + timeline", 2);
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}
gst_object_unref (timeline);
+ gst_object_unref (asset);
ges_deinit ();
}