-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note about freeing transaction in handle_message #3374
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better remove the dot at the end, after |
||
* @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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here (it was there before, but now there's |
||
* @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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that, since in this case this is a method that goes from core to plugin, it's more correct to say something like "The Janus core leaves ownership of both ...... objects to plugins. Ths means..". The "increases" part makes more sense for
push_event
since in that case the core does indeed increase the references to those objects, since plugins may decrease their own.