Fix a leak for the subfont when using other fonts than the default. Notes: Thu May 26 08:00:51 EDT 2005 rsc ignoring this since there is a stringwidth2 that is newer. Reference: /n/sources/patch/sorry/stringwidth Date: Thu May 26 13:30:54 CES 2005 Reviewed-by: rsc --- /sys/src/libdraw/stringwidth.c Thu May 26 13:29:18 2005 +++ /sys/src/libdraw/stringwidth.c Thu May 26 13:29:16 2005 @@ -12,6 +12,7 @@ Rune rune, **rptr; char *subfontname, **sptr; Font *def; + Subfont *sf; if(s == nil){ s = ""; @@ -43,13 +44,14 @@ return twid; } if(subfontname){ - if(_getsubfont(f->display, subfontname) == 0){ + if((sf=_getsubfont(f->display, subfontname)) == 0){ def = f->display->defaultfont; if(def && f!=def) f = def; else break; - } + } else + installsubfont(subfontname, sf); } } agefont(f);