From: Emden Gansner Date: Wed, 6 Mar 2013 20:30:04 +0000 (-0500) Subject: Fix bug in agmemread: subdisciplines need to last the life of the graph. X-Git-Tag: LAST_LIBGRAPH~32^2~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d248e4468ff73bc9a4a843514c83ed9e8fefaa0;p=graphviz Fix bug in agmemread: subdisciplines need to last the life of the graph. --- diff --git a/lib/cgraph/io.c b/lib/cgraph/io.c index cb44e6c7f..d6033a08c 100644 --- a/lib/cgraph/io.c +++ b/lib/cgraph/io.c @@ -120,14 +120,14 @@ memiofread(void *chan, char *buf, int bufsize) return l; } +static Agiodisc_t memIoDisc = {memiofread, 0, 0}; + Agraph_t *agmemread(const char *cp) { Agraph_t* g; rdr_t rdr; Agdisc_t disc; - Agiodisc_t memIoDisc; - memIoDisc.afread = memiofread; memIoDisc.putstr = AgIoDisc.putstr; memIoDisc.flush = AgIoDisc.flush; rdr.data = cp;