[Asterisk-code-review] sorcery: Fix cache creation callback. (asterisk[master])

Mark Michelson asteriskteam at digium.com
Tue May 26 13:11:18 CDT 2015


Mark Michelson has submitted this change and it was merged.

Change subject: sorcery: Fix cache creation callback.
......................................................................


sorcery: Fix cache creation callback.

The cache creation callback function expects to receive a sorcery_details
structure and not just a standalone object.

Change-Id: I3e4a5a137cb25292eb52d7a14cbb6daa09213450
---
M main/sorcery.c
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved; Verified
  George Joseph: Looks good to me, but someone else must approve



diff --git a/main/sorcery.c b/main/sorcery.c
index 732fb62..f84855e 100644
--- a/main/sorcery.c
+++ b/main/sorcery.c
@@ -1822,7 +1822,12 @@
 	}
 
 	if (!cached && object) {
-		AST_VECTOR_CALLBACK(&object_type->wizards, sorcery_cache_create, NULL, object, 0);
+		struct sorcery_details sdetails = {
+			.sorcery = sorcery,
+			.obj = object,
+		};
+
+		AST_VECTOR_CALLBACK(&object_type->wizards, sorcery_cache_create, NULL, &sdetails, 0);
 	}
 	AST_VECTOR_RW_UNLOCK(&object_type->wizards);
 
@@ -2332,4 +2337,4 @@
 const char *ast_sorcery_get_module(const struct ast_sorcery *sorcery)
 {
 	return sorcery->module_name;
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.asterisk.org/534
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e4a5a137cb25292eb52d7a14cbb6daa09213450
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list