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;
#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) {
fontname, fontpath);
}
}
+ if (freeFontpath) free (fontpath);
return textline->width;
}
}
*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 */
{
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, ":"));