X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/87c39468f57b12651ab8700eba05a2a11cfeaddb..28800061ff3b3913fc2e1cfbdc9d15211cf3a3f2:/src/xbt/context.c diff --git a/src/xbt/context.c b/src/xbt/context.c index d371757b8f..6ee172610e 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -187,9 +187,25 @@ void xbt_context_exit(void) { xbt_swag_free(context_to_destroy); while((context=xbt_swag_extract(context_living))) - xbt_context_destroy(context); + xbt_context_free(context); xbt_swag_free(context_living); init_context = current_context = NULL ; } + +void xbt_context_free(xbt_context_t context) +{ + int i ; + + xbt_swag_remove(context, context_living); + for(i=0;iargc; i++) + if(context->argv[i]) xbt_free(context->argv[i]); + if(context->argv) xbt_free(context->argv); + + if(context->cleanup_func) + context->cleanup_func(context->cleanup_arg); + xbt_context_destroy(context); + + return; +}