[Fontconfig] about FcFini
Keith Packard
keithp at keithp.com
Mon Mar 30 09:37:57 PDT 2009
On Mon, 2009-03-30 at 12:20 -0400, Behdad Esfahbod wrote:
> * Calling FcInit() is optional. All fontconfig entry points check and
> initialize the library if needed.
FcFini was added so that valgrind output could be used to discover leaks
in fontconfig. Normal applications should not use it, although I can see
why they might want to (eliminate memory usage after a period of using
fontconfig).
> * FcFini() is designed to only be called by debugging code from
> applications, not for normal use by other libraries.
Even so, it seems like it should be fairly easy to make it mostly
harmless to call FcFini in normal application use.
> > Would it be possible to use a ref count for the initialisation /
> > finalization of fontconfig ?
>
> It would be feasible if FcInit() was mandatory. But when it's optional, I'm
> not sure how to define the semantics. What will the implicit initialization
> do? Increase the ref count or not?
It sounds fairly easy to me - FcFini wouldn't actually do anything until
the ref count hit zero.
We'd presumably need to add another FcFiniReallyDoStuff so that people
wanting the current valgrind behaviour could still get that.
Or, perhaps, we should add a separate function that would do a
ref-counting version of FcFini instead.
--
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20090330/fb0d5138/attachment.pgp
More information about the Fontconfig
mailing list