A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leaks in msg examples.
[simgrid.git]
/
examples
/
msg
/
parallel_task
/
parallel_task.c
diff --git
a/examples/msg/parallel_task/parallel_task.c
b/examples/msg/parallel_task/parallel_task.c
index
89fc1c1
..
3a3825c
100644
(file)
--- a/
examples/msg/parallel_task/parallel_task.c
+++ b/
examples/msg/parallel_task/parallel_task.c
@@
-48,6
+48,7
@@
int test(int argc, char *argv[])
communication_amount, NULL);
MSG_parallel_task_execute(ptask);
communication_amount, NULL);
MSG_parallel_task_execute(ptask);
+ MSG_task_destroy(ptask);
/* There is no need to free that! */
/* free(communication_amount); */
/* free(computation_amount); */
/* There is no need to free that! */
/* free(communication_amount); */
/* free(computation_amount); */
@@
-61,13
+62,16
@@
int test(int argc, char *argv[])
MSG_error_t test_all(const char *platform_file)
{
MSG_error_t res = MSG_OK;
MSG_error_t test_all(const char *platform_file)
{
MSG_error_t res = MSG_OK;
+ m_host_t *hosts;
MSG_config("workstation/model", "ptask_L07");
MSG_set_channel_number(1);
MSG_create_environment(platform_file);
MSG_config("workstation/model", "ptask_L07");
MSG_set_channel_number(1);
MSG_create_environment(platform_file);
- MSG_process_create("test", test, NULL, MSG_get_host_table()[0]);
+ hosts = MSG_get_host_table();
+ MSG_process_create("test", test, NULL, hosts[0]);
res = MSG_main();
res = MSG_main();
+ xbt_free(hosts);
INFO1("Simulation time %g", MSG_get_clock());
return res;
INFO1("Simulation time %g", MSG_get_clock());
return res;