validate: Fix leaks in ssim components

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7782>
This commit is contained in:
Edward Hervey 2024-10-29 15:36:49 +01:00 committed by GStreamer Marge Bot
parent 60e6b62dae
commit 36b32de831
2 changed files with 6 additions and 0 deletions

View file

@ -417,6 +417,7 @@ gssim_finalize (GObject * object)
g_free (self->priv->orgmu); g_free (self->priv->orgmu);
g_free (self->priv->windows); g_free (self->priv->windows);
g_free (self->priv->weights);
chain_up (object); chain_up (object);
} }

View file

@ -173,6 +173,7 @@ runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self)
ref_path = g_build_path (G_DIR_SEPARATOR_S, compared_files_dir, ref_path = g_build_path (G_DIR_SEPARATOR_S, compared_files_dir,
refname, NULL); refname, NULL);
g_free (refname);
if (!gst_validate_ssim_compare_image_files (ssim, ref_path, frame->path, if (!gst_validate_ssim_compare_image_files (ssim, ref_path, frame->path,
&mssim, &lowest, &highest, self->priv->result_outdir)) &mssim, &lowest, &highest, self->priv->result_outdir))
@ -191,6 +192,8 @@ runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self)
g_free (bname); g_free (bname);
} }
gst_object_unref (ssim);
gst_validate_printf (NULL, gst_validate_printf (NULL,
"\nAverage similarity: %f, min_avg: %f, min_min: %f\n", "\nAverage similarity: %f, min_avg: %f, min_min: %f\n",
total_avg / nfiles, min_avg, min_min); total_avg / nfiles, min_avg, min_min);
@ -410,6 +413,8 @@ _finalize (GObject * object)
if (priv->config) if (priv->config)
gst_structure_free (priv->config); gst_structure_free (priv->config);
G_OBJECT_CLASS (validate_ssim_override_parent_class)->finalize (object);
} }
static void static void