X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4bf3ecd5aa10fb43630aeb205c89e86a1bf01e45..c40d9806f658ba76d747939d667f87883b8aab1a:/src/msg/msg_vm.c diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 948c8dedc3..4eb77b0ee4 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -158,3 +158,18 @@ void MSG_vm_shutdown(msg_vm_t vm) { MSG_process_kill(process); } } + +/** @brief Destroy a msg_vm_t. + * @ingroup msg_VMs + */ +void MSG_vm_destroy(msg_vm_t vm) { + unsigned int cpt; + m_process_t process; + xbt_dynar_foreach(vm->processes,cpt,process) { + //FIXME: Slow ? + simdata_process_t simdata = simcall_process_get_data(process); + simdata->vm = NULL; + } + xbt_dynar_free(&vm->processes); + xbt_free(vm); +}