From: Matthew Jordan Date: Mon, 10 Jun 2013 22:38:04 +0000 (+0000) Subject: Make the reload stasis message bump the ref count of its sub-object X-Git-Tag: 13.0.0-beta1~1687 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed85661f43ae5ea5cbca3055f64964964e79e845;p=thirdparty%2Fasterisk.git Make the reload stasis message bump the ref count of its sub-object JSON objects are reference stealing. Hence, if you've RAII_VAR'd some subobject and want to pack it into another JSON object, you have to bump the reference count. Using the 'O' option during the pack will bump the reference count for you. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391314 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/loader.c b/main/loader.c index 7e5a5ae3ba..be08d7f962 100644 --- a/main/loader.c +++ b/main/loader.c @@ -750,7 +750,7 @@ static void publish_reload_message(const char *name, enum ast_module_reload_resu event_object = ast_json_pack("{s: s, s: s}", "Module", S_OR(name, "All"), "Status", res_buffer); - json_object = ast_json_pack("{s: s, s: i, s: o}", + json_object = ast_json_pack("{s: s, s: i, s: O}", "type", "Reload", "class_type", EVENT_FLAG_SYSTEM, "event", event_object);