diff --git a/src/tgen-graph.c b/src/tgen-graph.c index 6252c95..aeefaad 100644 --- a/src/tgen-graph.c +++ b/src/tgen-graph.c @@ -1270,9 +1270,6 @@ TGenGraph* tgengraph_new(gchar* path) { * from multiple threads at the same time. this is not a problem when shadow * uses dlmopen to get a private namespace for each plugin. */ - /* use the built-in C attribute handler */ - igraph_attribute_table_t* oldHandler = igraph_set_attribute_table(&igraph_cattribute_table); - g->graph = _tgengraph_loadNewGraph(g->graphPath); if(!g->graph) { error = g_error_new(G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, @@ -1289,9 +1286,6 @@ TGenGraph* tgengraph_new(gchar* path) { if(!error) { error = _tgengraph_parseGraphVertices(g); } - - /* replace the old handler */ - igraph_set_attribute_table(oldHandler); } if(error) { diff --git a/src/tgen-main.c b/src/tgen-main.c index 592bc06..bf41e33 100644 --- a/src/tgen-main.c +++ b/src/tgen-main.c @@ -10,6 +10,7 @@ #include #include "tgen.h" +#include "tgen-igraph-compat.h" static void _tgenmain_cleanup(gint status, gpointer arg) { if(arg) { @@ -82,6 +83,9 @@ static gint _tgenmain_run(gint argc, gchar *argv[]) { tgen_message("Set SIG_IGN for signal SIGPIPE"); } + /* use the built-in C attribute handler. this is set once and then left alone. */ + igraph_set_attribute_table(&igraph_cattribute_table); + /* parse the config file */ TGenGraph* graph = tgengraph_new(argv[1]); if (!graph) { diff --git a/src/tgen-markovmodel.c b/src/tgen-markovmodel.c index 2514108..e0a8ba7 100644 --- a/src/tgen-markovmodel.c +++ b/src/tgen-markovmodel.c @@ -880,10 +880,6 @@ static igraph_t* _tgenmarkovmodel_loadGraph(FILE* graphFileStream, const gchar* rewind(graphFileStream); igraph_t* graph = g_new0(igraph_t, 1); - - /* make sure we use the correct attribute handler */ - igraph_set_attribute_table(&igraph_cattribute_table); - result = igraph_read_graph_graphml(graph, graphFileStream, 0); if (result != IGRAPH_SUCCESS) { diff --git a/test/test-markovmodel.c b/test/test-markovmodel.c index 819f88a..63b3961 100644 --- a/test/test-markovmodel.c +++ b/test/test-markovmodel.c @@ -2,7 +2,9 @@ #include #include +#include +#include "tgen-igraph-compat.h" #include "tgen-log.h" #include "tgen-markovmodel.h" @@ -87,6 +89,9 @@ gint main(gint argc, gchar *argv[]) { return EXIT_FAILURE; } + /* use the built-in C attribute handler. this is set once and then left alone. */ + igraph_set_attribute_table(&igraph_cattribute_table); + guint32 seed = (guint32)atoi(argv[1]); gchar* path = g_strdup(argv[2]); gchar* name = g_path_get_basename(path);