mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 22:58:21 +00:00
app: Remove silly usage of RAII_VAR.
Change-Id: Ideb594f7aae134974fb78d5477ba0853b97b8625
This commit is contained in:
13
main/app.c
13
main/app.c
@@ -3138,7 +3138,7 @@ struct stasis_topic *ast_mwi_topic(const char *uniqueid)
|
|||||||
|
|
||||||
struct ast_mwi_state *ast_mwi_create(const char *mailbox, const char *context)
|
struct ast_mwi_state *ast_mwi_create(const char *mailbox, const char *context)
|
||||||
{
|
{
|
||||||
RAII_VAR(struct ast_mwi_state *, mwi_state, NULL, ao2_cleanup);
|
struct ast_mwi_state *mwi_state;
|
||||||
|
|
||||||
ast_assert(!ast_strlen_zero(mailbox));
|
ast_assert(!ast_strlen_zero(mailbox));
|
||||||
|
|
||||||
@@ -3148,6 +3148,7 @@ struct ast_mwi_state *ast_mwi_create(const char *mailbox, const char *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ast_string_field_init(mwi_state, 256)) {
|
if (ast_string_field_init(mwi_state, 256)) {
|
||||||
|
ao2_ref(mwi_state, -1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!ast_strlen_zero(context)) {
|
if (!ast_strlen_zero(context)) {
|
||||||
@@ -3156,7 +3157,6 @@ struct ast_mwi_state *ast_mwi_create(const char *mailbox, const char *context)
|
|||||||
ast_string_field_set(mwi_state, uniqueid, mailbox);
|
ast_string_field_set(mwi_state, uniqueid, mailbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
ao2_ref(mwi_state, +1);
|
|
||||||
return mwi_state;
|
return mwi_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3329,8 +3329,8 @@ struct stasis_message *ast_mwi_blob_create(struct ast_mwi_state *mwi_state,
|
|||||||
struct stasis_message_type *message_type,
|
struct stasis_message_type *message_type,
|
||||||
struct ast_json *blob)
|
struct ast_json *blob)
|
||||||
{
|
{
|
||||||
RAII_VAR(struct ast_mwi_blob *, obj, NULL, ao2_cleanup);
|
struct ast_mwi_blob *obj;
|
||||||
RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
|
struct stasis_message *msg;
|
||||||
|
|
||||||
ast_assert(blob != NULL);
|
ast_assert(blob != NULL);
|
||||||
|
|
||||||
@@ -3349,11 +3349,8 @@ struct stasis_message *ast_mwi_blob_create(struct ast_mwi_state *mwi_state,
|
|||||||
|
|
||||||
/* This is not a normal MWI event. Only used by the MinivmNotify app. */
|
/* This is not a normal MWI event. Only used by the MinivmNotify app. */
|
||||||
msg = stasis_message_create(message_type, obj);
|
msg = stasis_message_create(message_type, obj);
|
||||||
if (!msg) {
|
ao2_ref(obj, -1);
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
ao2_ref(msg, +1);
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user