Thursday 15 May 2014

c - What's the point of FcFini in the fontconfig library? -



c - What's the point of FcFini in the fontconfig library? -

the fontconfig library has function fcfini.

the docs say

fcfini [...]

frees info structures allocated previous calls fontconfig functions. fontconfig returns uninitialized state, requiring new phone call 1 of fcinit functions before other fontconfig function may called.

however, docs not why might want phone call it. free memory, cannot imagine fontconfig gobble vast amounts of memory. @ rate, unless can create sure i'll never phone call fontconfig again, can phone call fcfini @ end of program, releasing memory pointless. why bother?

incidentally, noticed cairo rendering library, uses fontconfig, calls fcfini in test code, never in production code. seems cairo authors don't see point of calling it... or wrong?

a typical reason getting valid output valgrind or purify. if have leaks @ exit, might want cut down in debug or test builds.

c resource-cleanup fontconfig

No comments:

Post a Comment