diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2016-05-24 14:05:37 +0000 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2016-05-24 10:29:03 -0400 |
commit | 15e7f1bbfd84ce2cc5e6420fee2255c2be95e0f6 (patch) | |
tree | a413dd78d14aee18406809316a69f4f5dbb276f2 /validate/gst | |
parent | 4c6fce855ebf7b0b3c9d6e5f7127a1cad3361684 (diff) |
validate: fix monitor leak when doing frame analysis
The monitor returned by gst_validate_monitor_factory_create() was never
unreffed.
Report instances now have to keep a ref, as suggested by the TODO, as
the reporter is no longer leaked.
Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1012
Diffstat (limited to 'validate/gst')
-rw-r--r-- | validate/gst/validate/gst-validate-report.c | 3 | ||||
-rw-r--r-- | validate/gst/validate/media-descriptor-writer.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index 1053341b49..16277b8d3b 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -513,7 +513,7 @@ gst_validate_report_new (GstValidateIssue * issue, report->refcount = 1; report->issue = issue; - report->reporter = reporter; /* TODO should we ref? */ + report->reporter = g_object_ref (reporter); report->message = g_strdup (message); g_mutex_init (&report->shadow_reports_lock); report->timestamp = @@ -530,6 +530,7 @@ gst_validate_report_unref (GstValidateReport * report) g_return_if_fail (report != NULL); if (G_UNLIKELY (g_atomic_int_dec_and_test (&report->refcount))) { + g_object_unref (report->reporter); g_free (report->message); g_list_free_full (report->shadow_reports, (GDestroyNotify) gst_validate_report_unref); diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c index 4943bc70e7..7fa446978d 100644 --- a/validate/gst/validate/media-descriptor-writer.c +++ b/validate/gst/validate/media-descriptor-writer.c @@ -557,6 +557,7 @@ _run_frame_analysis (GstValidateMediaDescriptorWriter * writer, writer->priv->loop = NULL; gst_bus_remove_signal_watch (bus); gst_object_unref (bus); + g_object_unref (monitor); return TRUE; } |