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@xxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig