Add tags to stasis objects using the name. This makes it
easier to track the source of certain stasis ref leaks.
Review: https://reviewboard.asterisk.org/r/3821/
........
Merged revisions 418996 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418997
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
struct stasis_topic *topic;
int res = 0;
- topic = ao2_alloc(sizeof(*topic), topic_dtor);
+ topic = ao2_t_alloc(sizeof(*topic), topic_dtor, name);
if (!topic) {
return NULL;
}
}
/* The ao2 lock is used for join_cond. */
- sub = ao2_alloc(sizeof(*sub), subscription_dtor);
+ sub = ao2_t_alloc(sizeof(*sub), subscription_dtor, topic->name);
if (!sub) {
return NULL;
}
RAII_VAR(char *, cached_name, NULL, ast_free);
RAII_VAR(struct stasis_cp_all *, all, NULL, ao2_cleanup);
- all = ao2_alloc(sizeof(*all), all_dtor);
+ all = ao2_t_alloc(sizeof(*all), all_dtor, name);
if (!all) {
return NULL;
}
{
RAII_VAR(struct stasis_cp_single *, one, NULL, ao2_cleanup);
- one = ao2_alloc(sizeof(*one), one_dtor);
+ one = ao2_t_alloc(sizeof(*one), one_dtor, name);
if (!one) {
return NULL;
}
{
struct stasis_message_type *type;
- type = ao2_alloc(sizeof(*type), message_type_dtor);
+ type = ao2_t_alloc(sizeof(*type), message_type_dtor, name);
if (!type) {
return NULL;
}
return NULL;
}
- message = ao2_alloc(sizeof(*message), stasis_message_dtor);
+ message = ao2_t_alloc(sizeof(*message), stasis_message_dtor, type->name);
if (message == NULL) {
return NULL;
}
struct ast_event *stasis_message_to_event(struct stasis_message *msg)
{
return INVOKE_VIRTUAL(to_event, msg);
-}
\ No newline at end of file
+}
int res;
RAII_VAR(struct stasis_message_router *, router, NULL, ao2_cleanup);
- router = ao2_alloc(sizeof(*router), router_dtor);
+ router = ao2_t_alloc(sizeof(*router), router_dtor, topic->name);
if (!router) {
return NULL;
}