Added a uiFreeFontButtonFont() function to free resources allocated by uiFontButtonFont(), implemented it on Windows, and integrated it into the drawtext example. I'm going to continue chipping away at the Windows code for a bit longer, so I'll add this to the other platforms later.
This commit is contained in:
parent
78e0684435
commit
8709838a8f
|
@ -106,6 +106,7 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
|
|||
// TODO clip to margins
|
||||
uiDrawText(p->Context, textLayout, margins, margins);
|
||||
uiDrawFreeTextLayout(textLayout);
|
||||
uiFreeFontButtonFont(&defaultFont);
|
||||
}
|
||||
|
||||
static void handlerMouseEvent(uiAreaHandler *a, uiArea *area, uiAreaMouseEvent *e)
|
||||
|
|
|
@ -495,3 +495,4 @@ _UI_EXTERN void uiFontButtonFont(uiFontButton *b, uiFontDescriptor *desc);
|
|||
// TOOD SetFont, mechanics
|
||||
_UI_EXTERN void uiFontButtonOnChanged(uiFontButton *b, void (*f)(uiFontButton *, void *), void *data);
|
||||
_UI_EXTERN uiFontButton *uiNewFontButton(void);
|
||||
_UI_EXTERN void uiFreeFontButtonFont(uiFontDescriptor *desc);
|
||||
|
|
|
@ -121,3 +121,8 @@ uiFontButton *uiNewFontButton(void)
|
|||
|
||||
return b;
|
||||
}
|
||||
|
||||
void uiFreeFontButtonFont(uiFontDescriptor *desc)
|
||||
{
|
||||
uiprivFree((char *) (desc->Family));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue