> From: Aleksander Morgado <[email protected]> > Date: Wed, 14 Apr 2010 14:33:24 +0200 > > > > > * Initially, the printable string is not allocated. > > > * The first time this pdf_text_get_printable() method is called in a > > > given pdf_text_t, it will internally setup the proper string contents to > > > be returned. > > > * The following times this method is called, and IF the pdf_text_t > > > contents have not been modified, the same internal string is returned. > > > * Whenever the contents of the pdf_text_t are modified, the internal > > > buffer should be freed, so that any new call to pdf_text_get_printable() > > > will re-create the printable string again with the proper contents. > > > > > > > Hey Aleks, > > > > We shouldn't forget about multi-threading in that case, right ? > > > > Not really. Note that the internal buffer will not be common to all > pdf_text_t objects, but a different internal buffer in each pdf_text_t > (just as the standard internal buffer containing the UTF-32HE encoded > string). So, if the same object is to be used by different threads, then > the app using the object should provide proper sync mechanisms to access > the object. >
I understand, that's a good point. :-) cheers, -gerel
