From d6fccd8029644e59980f050e4b3a4509749643ba Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Sat, 11 May 2024 11:42:57 +0200 Subject: [PATCH] Add note about g_free transaction with handle_message in plugin interface documentation --- src/plugins/plugin.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h index 686a8db63f..d9e78dede4 100644 --- a/src/plugins/plugin.h +++ b/src/plugins/plugin.h @@ -283,6 +283,10 @@ struct janus_plugin { * @param[out] error An integer that may contain information about any error */ void (* const create_session)(janus_plugin_session *handle, int *error); /*! \brief Method to handle an incoming message/request from a peer + * @note The Janus core increases the references to both the \c message and \c jsep + * json_t objects. This means that you'll have to decrease your own + * reference yourself with a \c json_decref when you're done with them. + * You'll also have to free \c transaction with \c g_free. * @param[in] handle The plugin/gateway session used for this peer * @param[in] transaction The transaction identifier for this message/request * @param[in] message The json_t object containing the message/request JSON @@ -354,9 +358,9 @@ struct janus_plugin { /*! \brief Callbacks to contact the Janus core */ struct janus_callbacks { /*! \brief Callback to push events/messages to a peer - * @note The Janus core increases the references to both the message and jsep + * @note The Janus core increases the references to both the \c message and \c jsep * json_t objects. This means that you'll have to decrease your own - * reference yourself with a \c json_decref after calling push_event. + * reference yourself with a \c json_decref after calling \c push_event. * @param[in] handle The plugin/gateway session used for this peer * @param[in] plugin The plugin instance that is sending the message/event * @param[in] transaction The transaction identifier this message refers to