[poppler] GlobalParams

Albert Astals Cid aacid at kde.org
Sat May 13 09:19:36 PDT 2006


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


More information about the poppler mailing list