According to the ParserWriterTest.cpp of Poco:
AutoPtr<Document> pDoc = parser.parseString(XHTML);
parseString() will new a Document object and return this to caller.
If this pointer was assigned to AutoPtr, this Document object will be de-constructed by caller, instead of Poco lib itself.
I don't think it is the correct usage. Since the Document object is built by "parser", it should be destroyed by "parser" too.
if it was assigned to a AutoPtr, after AutoPto leave its scope, it will be de-constructed automatically.
Am i right ?





