mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
message: add gst_clear_message()
Basically, you can use this instead of using gst_message_unref (which needs to be preceded by a NULL-check). Also fixes #275
This commit is contained in:
parent
efbfa54a4a
commit
24f1fb252a
1 changed files with 19 additions and 0 deletions
|
@ -379,6 +379,25 @@ gst_message_unref (GstMessage * msg)
|
||||||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (msg));
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_clear_message: (skip)
|
||||||
|
* @msg_ptr: a pointer to a #GstMessage reference
|
||||||
|
*
|
||||||
|
* Clears a reference to a #GstMessage.
|
||||||
|
*
|
||||||
|
* @msg_ptr must not be %NULL.
|
||||||
|
*
|
||||||
|
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||||
|
* reference count of the message is decreased and the pointer is set to %NULL.
|
||||||
|
*
|
||||||
|
* Since: 1.16
|
||||||
|
*/
|
||||||
|
static inline void
|
||||||
|
gst_clear_message (GstMessage ** msg_ptr)
|
||||||
|
{
|
||||||
|
gst_clear_mini_object (msg_ptr);
|
||||||
|
}
|
||||||
|
|
||||||
/* copy message */
|
/* copy message */
|
||||||
/**
|
/**
|
||||||
* gst_message_copy:
|
* gst_message_copy:
|
||||||
|
|
Loading…
Reference in a new issue