From: Emden Gansner Date: Mon, 9 Jul 2012 21:08:20 +0000 (-0400) Subject: Add and advertise a free function for dynamically allocated paths X-Git-Tag: LAST_LIBGRAPH~32^2~379 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0127426490821628d9b95a7c4180cfd14367237;p=graphviz Add and advertise a free function for dynamically allocated paths --- diff --git a/lib/pathplan/pathgeom.h b/lib/pathplan/pathgeom.h index 270d41c67..521578237 100644 --- a/lib/pathplan/pathgeom.h +++ b/lib/pathplan/pathgeom.h @@ -45,6 +45,7 @@ extern "C" { /* opaque state handle for visibility graph operations */ typedef struct vconfig_s vconfig_t; + void freePath(Ppolyline_t* p); #ifdef __cplusplus } #endif diff --git a/lib/pathplan/util.c b/lib/pathplan/util.c index c3e7e65d5..e2d31ce10 100644 --- a/lib/pathplan/util.c +++ b/lib/pathplan/util.c @@ -34,6 +34,12 @@ Ppoly_t copypoly(Ppoly_t argpoly) return rv; } +void freePath(Ppolyline_t* p) +{ + free(p->ps); + free(p); +} + void freepoly(Ppoly_t argpoly) { free(argpoly.ps);