Re: Sanity Check

Charlie <[email protected]> Fri, 30 Nov 2012 08:53:14 -0500
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Made me look.  At the source, that is.

But, yes, TidyDoc->errout is referenced only in localize.c and 
access.c.   As you suggest, the methods in those files are called 
from the parse/clean/report calls.  So, if you just want to load and 
navigate the document tree, you may get away with leaving the 
dangling reference to your error buffer.

It would be safer to create a dummy TidyOutputSink and call 
tidySetErrorSink().  This will release the previous error buffer and 
replace it with your placeholder object.

But, as always, test your specific use cases before going into production.

At 04:53 PM 11/29/2012, Christopher Woods wrote:
>I was looking at some old code and just need a quick sanity check...
>
>If I'm calling tidyDocSetErrorBuffer() does the buffer's lifetime 
>need to be guaranteed to exceed that of the TidyDoc? Or is it really 
>sufficient that it exists during the 
>tidyParseXXXX()/tidyCleanAndRepair()/tidyRunDiagnostics calls? (I 
>never call anything that prettyprints/saves the output.)
>
>Thanks,
>-Chris


------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net