Otto,
If you mean this font in Class TRibbonBar:
- Code: Select all Expand view
if ::oFont == nil
::oFont := TFont():New()
::oFont:hFont := GetStockObject( DEFAULT_GUI_FONT )
endif
there is no need to destroy it as it uses a Windows own hFont.
If you create a font using:
- Code: Select all Expand view
DEFINE FONT oFont NAME ... SIZE ..., ...
then after is used by an object (window, dialog, control, printer) you have to destroy it yourself:
- Code: Select all Expand view
oFont:End()
Fonts reuse their hFont handles to reduce GDI memory consume, using a counter which gets incremented when the font is assigned to an object and decremented when the object is End()ed. But when we do oFont:End() then the counter is decreased to zero and then it is really destroyed