David,

Please do not delete:
    delete pDomImpl;

You do not need to delete any DOM object returned from DOM.   You can call
release() to release any "orphaned" resources that weree created by factory
method createXXXX.   see
http://xml.apache.org/xerces-c/ApacheDOMC++BindingL2.html for more details.

Tinny

----- Original Message -----
From: "David C." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 8:25 AM
Subject: core dump in XMLPlatformUtils::Terminate(); and
XMLPlatformUtils::Initialize();


> Hi !
> this code coredumps on solaris 2.7 using libxerces-c v2.1 in the first
call
> to method Terminate .
>
> debugger output:
> =============
>
> (gdb) backtrace
> #0  0x0 in ?? ()
> #1  0xff15d6fc in reinitImplementation () from
> /sw/local/develsup/xerces/xercesc_2_1_0Sol2.7ForCC/lib/libxerces-c.so.21
> #2  0xff19b880 in XMLPlatformUtils::Terminate () from
> /sw/local/develsup/xerces/xercesc_2_1_0Sol2.7ForCC/lib/libxerces-c.so.21
> #3  0x10a3c in main ()
>
> sourcecode:
> ==========
>
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/sax/HandlerBase.hpp>
> #include <xercesc/dom/DOM.hpp>
> #include <xercesc/dom/DOMNode.hpp>
> #include <xercesc/dom/DOMException.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/validators/common/Grammar.hpp>
> #include <xercesc/framework/StdOutFormatTarget.hpp>
> #include <xercesc/framework/MemBufFormatTarget.hpp>
> #include <xercesc/framework/MemBufInputSource.hpp>
> #include <string>
>
> int main(int argc,char** argv)
> {
>    std::cout << "init" << std::endl;
>    XMLPlatformUtils::Initialize();
>    {
>    XMLCh tempStr[4];
>    XMLString::transcode("LS", tempStr, 3);
>
>    XMLCh schemaTyp[35];
>    XMLString::transcode("http://www.w3.org/2001/XMLSchema",schemaTyp,34);
>    DOMImplementation* pDomImpl=
> DOMImplementationRegistry::getDOMImplementation(tempStr);
> //   DOMBuilder* pParser =
> pDomImpl->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS,0);
> //   DOMWriter*  pWriter = pDomImpl->createDOMWriter();
>
>
> //   delete pParser;
> //   delete pWriter;
>    delete pDomImpl;
>    }
>    std::cout << "terminate" << std::endl;
>    XMLPlatformUtils::Terminate();
>    std::cout << "init2" << std::endl;
>    XMLPlatformUtils::Initialize();
>    std::cout << "terminate2" << std::endl;
>    XMLPlatformUtils::Terminate();
>    return 0;
> }
>
>
> but this code works:
> ===============
>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <string>
>
> int main(int argc,char** argv)
> {
>    std::cout << "init" << std::endl;
>    XMLPlatformUtils::Initialize();
>    std::cout << "terminate" << std::endl;
>    XMLPlatformUtils::Terminate();
>    std::cout << "init2" << std::endl;
>    XMLPlatformUtils::Initialize();
>    std::cout << "terminate2" << std::endl;
>    XMLPlatformUtils::Terminate();
>    return 0;
> }
>
> is this fixed in a later version of xerces-c ?
>
> Thanks and greetings
>   david c.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to