mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
validate-report: Make the ref / unref functions safer.
This commit is contained in:
parent
1fcaf8918f
commit
b8ac717297
1 changed files with 4 additions and 0 deletions
|
@ -432,6 +432,8 @@ gst_validate_report_new (GstValidateIssue * issue,
|
|||
void
|
||||
gst_validate_report_unref (GstValidateReport * report)
|
||||
{
|
||||
g_return_if_fail (report != NULL);
|
||||
|
||||
if (G_UNLIKELY (g_atomic_int_dec_and_test (&report->refcount))) {
|
||||
g_free (report->message);
|
||||
g_slice_free (GstValidateReport, report);
|
||||
|
@ -441,6 +443,8 @@ gst_validate_report_unref (GstValidateReport * report)
|
|||
GstValidateReport *
|
||||
gst_validate_report_ref (GstValidateReport * report)
|
||||
{
|
||||
g_return_val_if_fail (report != NULL, NULL);
|
||||
|
||||
g_atomic_int_inc (&report->refcount);
|
||||
|
||||
return report;
|
||||
|
|
Loading…
Reference in a new issue