validate: Don't call gst_debug_log_valist() if debugging is disabled

And also stop leaking a string every time.
This commit is contained in:
Sebastian Dröge 2014-06-28 12:33:45 +02:00
parent 3ecd8352eb
commit b6c439ee88

View file

@ -130,7 +130,7 @@ gst_validate_report_valist (GstValidateReporter * reporter,
g_hash_table_insert (priv->reports, (gpointer) issue_id, g_hash_table_insert (priv->reports, (gpointer) issue_id,
gst_validate_report_ref (report)); gst_validate_report_ref (report));
} }
#ifndef GST_DISABLE_GST_DEBUG
combo = combo =
g_strdup_printf ("<%s> %" GST_VALIDATE_ISSUE_FORMAT " : %s", priv->name, g_strdup_printf ("<%s> %" GST_VALIDATE_ISSUE_FORMAT " : %s", priv->name,
GST_VALIDATE_ISSUE_ARGS (issue), format); GST_VALIDATE_ISSUE_ARGS (issue), format);
@ -147,10 +147,8 @@ gst_validate_report_valist (GstValidateReporter * reporter,
else else
gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, __FILE__, gst_debug_log_valist (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, __FILE__,
GST_FUNCTION, __LINE__, NULL, combo, vacopy); GST_FUNCTION, __LINE__, NULL, combo, vacopy);
g_free (combo); g_free (combo);
combo = g_strdup_printf ("Received error report %" GST_VALIDATE_ISSUE_FORMAT #endif
" : %s", GST_VALIDATE_ISSUE_ARGS (issue), format);
gst_validate_report_check_abort (report); gst_validate_report_check_abort (report);