From: ellson Date: Tue, 18 Oct 2005 19:05:55 +0000 (+0000) Subject: Change test data a3.dot to reflect the bug fix for graph labels and X-Git-Tag: LAST_LIBGRAPH~32^2~7159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7994b57b419830071c63c2edbf92afedc07c846f;p=graphviz Change test data a3.dot to reflect the bug fix for graph labels and rankdir=BT; don't print any config file info with -v if plugins are disabled; move free of fontpath malloced in libgd to after possible use. --- diff --git a/lib/common/fontmetrics.c b/lib/common/fontmetrics.c index 9a3a21681..b43d033b6 100644 --- a/lib/common/fontmetrics.c +++ b/lib/common/fontmetrics.c @@ -201,6 +201,7 @@ estimate_textsize(textline_t * textline, char *fontname, double fontsz, double textwidth(textline_t * textline, char *fontname, double fontsize) { char *fontpath = NULL; + int freeFontpath = 0; #ifdef CAIRO_HAS_FT_FONT cairo_t *cr; cairo_text_extents_t extents; @@ -217,6 +218,8 @@ double textwidth(textline_t * textline, char *fontname, double fontsize) #else if (gd_textsize(textline, fontname, fontsize, &fontpath)) estimate_textsize(textline, fontname, fontsize, &fontpath); + else + freeFontpath = 1; /* libgd mallocs space for fontpath */ #endif if (Verbose) { @@ -225,5 +228,6 @@ double textwidth(textline_t * textline, char *fontname, double fontsize) fontname, fontpath); } } + if (freeFontpath) free (fontpath); return textline->width; } diff --git a/lib/common/gdtextsize.c b/lib/common/gdtextsize.c index ad5e03244..572a77aef 100644 --- a/lib/common/gdtextsize.c +++ b/lib/common/gdtextsize.c @@ -125,7 +125,6 @@ char *gd_textsize(textline_t * textline, char *fontname, double fontsz, } *fontpath = strex.fontpath; - if (strex.fontpath) free (strex.fontpath); if (textline->str && textline->str[0]) { /* can't use brect on some archtectures if strlen 0 */ diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index ee0d17c1c..34cbfa94e 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -332,11 +332,13 @@ void gvplugin_write_status(GVC_t * gvc) { int api; +#ifndef DISABLE_LTDL fprintf(stderr,"The plugin configuration file:\n\t%s\n", gvc->config_path); if (gvc->config_found) fprintf(stderr,"\t\twas successfully loaded.\n"); else fprintf(stderr,"\t\twas not found or not usable. No on-demand plugins.\n"); +#endif for (api = 0; api < ARRAY_SIZE(api_names); api++) { fprintf(stderr," %s\t: %s\n", api_names[api], gvplugin_list(gvc, api, ":"));