[poppler] fontconfig not shut down

Albert Astals Cid aacid at kde.org
Sun Mar 29 11:08:48 PDT 2009


A Diumenge, 29 de març de 2009, Vincent Torri va escriure:
> Hey,
>
> in the destructor of a globalParams, fontconfig is not shut dows while it
> is initialized in the constructor.

The problem with this patch is that FcInit is ok if you already had called it 
somewhere else (Qt, Pango, etc) but FcFini is bad because it'll finish 
fontconfig and you won't be able to use it again after deleting GlobalParams. 

I see there's a potential problem here but this is not the solution, maybe the 
solution would be not calling FcInit at all and asking the poppler user to 
pass it along but i doubt Qt let's you access its internal FontConfig member.

All in all i don't think this is a BIG problem since you're supposed to only 
have a GlobalParams for all the lifetime of your program.

Albert

>
> Here is a patch:
>
>
> diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
> index 9c42f36..4e935dc 100644
> --- a/poppler/GlobalParams.cc
> +++ b/poppler/GlobalParams.cc
> @@ -835,6 +835,10 @@ GlobalParams::~GlobalParams() {
>     gDestroyMutex(&unicodeMapCacheMutex);
>     gDestroyMutex(&cMapCacheMutex);
>   #endif
> +
> +#ifndef _MSC_VER
> +  FcFini();
> +#endif
>   }
>
>
> //------------------------------------------------------------------------
>
>
>
> I'm not sure that one should also call
>
> FcConfigDestroy(FCcfg);
>
> before FcFini().
>
> regards
>
> Vincent Torri
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler




More information about the poppler mailing list