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
kill a very old TODO file. We don't care of running mmalloc between several (system...
[simgrid.git]
/
src
/
xbt
/
graph.c
diff --git
a/src/xbt/graph.c
b/src/xbt/graph.c
index
fdf9f5f
..
61b8364
100644
(file)
--- a/
src/xbt/graph.c
+++ b/
src/xbt/graph.c
@@
-140,35
+140,30
@@
void xbt_graph_free_graph(xbt_graph_t g,
void_f_pvoid_t edge_free_function,
void_f_pvoid_t graph_free_function)
{
void_f_pvoid_t edge_free_function,
void_f_pvoid_t graph_free_function)
{
- unsigned int cursor
= 0
;
- xbt_node_t node
= NULL
;
- xbt_edge_t edge
= NULL
;
+ unsigned int cursor;
+ xbt_node_t node;
+ xbt_edge_t edge;
+ xbt_dynar_foreach(g->edges, cursor, edge) {
+ if (edge_free_function)
+ edge_free_function(edge->data);
+ free(edge);
+ }
+ xbt_dynar_free(&(g->edges));
xbt_dynar_foreach(g->nodes, cursor, node) {
xbt_dynar_free(&(node->out));
xbt_dynar_free(&(node->in));
if (node_free_function)
node_free_function(node->data);
xbt_dynar_foreach(g->nodes, cursor, node) {
xbt_dynar_free(&(node->out));
xbt_dynar_free(&(node->in));
if (node_free_function)
node_free_function(node->data);
+ free(node);
}
}
-
- xbt_dynar_foreach(g->edges, cursor, edge) {
- if (edge_free_function)
- edge_free_function(edge->data);
- }
-
- xbt_dynar_foreach(g->nodes, cursor, node)
- free(node);
xbt_dynar_free(&(g->nodes));
xbt_dynar_free(&(g->nodes));
- xbt_dynar_foreach(g->edges, cursor, edge)
- free(edge);
- xbt_dynar_free(&(g->edges));
if (graph_free_function)
graph_free_function(g->data);
free(g);
xbt_graph_parse_lex_destroy();
if (graph_free_function)
graph_free_function(g->data);
free(g);
xbt_graph_parse_lex_destroy();
- return;
}
}