From: John Ellson Date: Tue, 9 Feb 2016 18:09:54 +0000 (-0500) Subject: revert previous change - breaks build X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af81e92d1e975a5bd8a9d5ee590ba1478eb8a569;p=graphviz revert previous change - breaks build --- diff --git a/lib/gvc/gvcontext.c b/lib/gvc/gvcontext.c index 65c2aa341..7600e14ae 100644 --- a/lib/gvc/gvcontext.c +++ b/lib/gvc/gvcontext.c @@ -75,13 +75,6 @@ int gvFreeContext(GVC_t * gvc) { GVG_t *gvg, *gvg_next; gvplugin_package_t *package, *package_next; - gvplugin_available_t *api, *api_next; - -#define ELEM(x) +1 - /* See gvcext.h for APIS and gvcint.h for an example usage of "+1" - to get the number of APIs. */ - unsigned int num_apis = APIS, i; -#undef ELEM emit_once_reset(); gvg_next = gvc->gvgs; @@ -102,15 +95,25 @@ int gvFreeContext(GVC_t * gvc) if (gvc->input_filenames) free(gvc->input_filenames); textfont_dict_close(gvc); + free(gvc); + return (graphviz_errors + agerrors()); +} - for (i = 0; i != num_apis; ++i) { - for (api = gvc->apis[i]; api != NULL; api = api_next) { - api_next = api->next; - free(api); - } - } +GVC_t* gvCloneGVC (GVC_t * gvc0) +{ + GVC_t *gvc = zmalloc(sizeof(GVC_t)); + gvc->common = gvc0->common; + memcpy (&gvc->apis, &gvc0->apis, sizeof(gvc->apis)); + memcpy (&gvc->api, &gvc0->api, sizeof(gvc->api)); + gvc->packages = gvc->packages; + + return gvc; +} + +void gvFreeCloneGVC (GVC_t * gvc) +{ + gvjobs_delete(gvc); free(gvc); - return (graphviz_errors + agerrors()); }