[poppler] GlobalParams

Albert Astals Cid aacid at kde.org
Tue May 16 14:04:44 PDT 2006


It seems i'm wrong i used test-poppler-qt4 and test-poppler-glib and seems 
they use a different globalParams object and even i do
start test-poppler-qt4
start test-poppler-glib 
kill test-poppler-glib 
keep using test-poppler-qt4

the test-poppler-qt4 globalParams is the original one he created and not one 
corrupted by the creation and destruction of another one in test-poppler-glib 

So it seems that's not a problem at the moment :-)

Albert

A Dissabte 13 Maig 2006 18:19, Albert Astals Cid va escriure:
> I was thinking about the Carlos' suggestion to refcount globalParams. I
> said i did not like it because i don't want the library to decide to delete
> something behind my back, but....
>
> Now i was thinking that all the processes that are using libpoppler.so at
> the same time use the same instance of the globalParams variable, and if
> that i decide to delete it from libpoppler-qt4 and there was someone using
> libpoppler-glib at the same time, it will probably will be a bad thing
> right?
>
> So that has to be fixed:
>  a) like Carlos said, refcounting in GlobalParams
>  b) removing the
>           extern GlobalParams *globalParams;
>      and making apps pass a *globalParams to PDFDoc so it's the app
> responsability of creating destroying the globalParams and there will be
> one different from each app using libpoppler
>
> For me b) is much better, because it would be quite surprising that i
> called setPSPaperSize from oKular and that affected the instance of evince
> i could have open at the moment, and i think that would happend with a)
> solution.
>
> Does everyone agree b) is the best solution?
>
> BTW this is all based on my little knowledge on how extern variables work
> on shared libraries.
>
> Albert
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list