]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
sorcery: Fix cache creation callback. 41/841/1
authorJoshua Colp <jcolp@digium.com>
Tue, 26 May 2015 12:44:18 +0000 (09:44 -0300)
committerMark Michelson <mmichelson@digium.com>
Wed, 8 Jul 2015 21:30:55 +0000 (16:30 -0500)
The cache creation callback function expects to receive a sorcery_details
structure and not just a standalone object.

Change-Id: Id2a9e5f271c466686e6d0def461fa50c8b2cae53

main/sorcery.c

index b89fabd6f669eb5e7ef110f7476a4c2157fe4d22..d0b46c5b45adfd93470d2378ed159bccbdcb90c5 100644 (file)
@@ -1723,7 +1723,12 @@ void *ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *
        ao2_iterator_destroy(&i);
 
        if (!cached && object) {
-               ao2_callback(object_type->wizards, 0, sorcery_cache_create, object);
+               struct sorcery_details sdetails = {
+                       .sorcery = sorcery,
+                       .obj = object,
+               };
+
+               ao2_callback(object_type->wizards, 0, sorcery_cache_create, &sdetails);
        }
 
        return object;