From 7a622c84067e5298d9f9a3f3d78bc3da04896c96 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 31 Dec 2015 03:30:03 -0500 Subject: ammgc_get_unit_entities(): initial implementation and integration. --- src/driver/amgc_unit_ctx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/driver') diff --git a/src/driver/amgc_unit_ctx.c b/src/driver/amgc_unit_ctx.c index 4da986a..334ee32 100644 --- a/src/driver/amgc_unit_ctx.c +++ b/src/driver/amgc_unit_ctx.c @@ -22,6 +22,9 @@ static int amgc_free_unit_ctx_impl(struct amgc_unit_ctx_impl * ctx, int status) { if (ctx) { + if (ctx->entities) + amgc_free_unit_entities(ctx->entities); + amgc_unmap_input(&ctx->map); free(ctx); } @@ -155,9 +158,10 @@ int amgc_get_unit_ctx( ctx->uctx.map = &ctx->map; ctx->uctx.cctx = &ctx->cctx; ctx->uctx.meta = &ctx->meta; + ctx->uctx.entities = ctx->entities; ctx->uctx.ccunit= &ctx->ccunit; - if (amgc_init_unit_meta(&ctx->uctx,&ctx->meta)) + if (amgc_get_unit_entities(&ctx->uctx,&ctx->meta,&ctx->entities)) return amgc_free_unit_ctx_impl(ctx,-1); *pctx = &ctx->uctx; -- cgit v1.2.3