You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Rudolf Wiener <ru...@wiener.at> on 2001/04/01 11:55:49 UTC
can't delete char-ptr from DOMString.transcode()
I am using Xerces 1.4.0 under Win2K with VC6.
The following code snippet asserts in debug mode:
char* p = myNode.getNodeName().transcode();
delete p;
The code is inside a DLL which is being called from an EXE.
The reason for the assert is, I believe, the fact that Xerces was
first initialized in a different address space. VC's debug
runtime checks whether memory to be deleted is from the _local_
heap. If not, it asserts.
Both the EXE and the DLL use Xerces. The EXE builds
a DOM and serializes it into a string. Then it calls the DLL
which receives the XML string as a parameter and parses this to
build a DOM again.
As the DLL might be used by other programs as well (which won't
use Xerces) I initialize the platform utilities in both the EXE
and the DLL.
Is there a way to load a second, local, instance of Xerces so
I could avoid this problem with delete?
Regards
Rudi
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: can't delete char-ptr from DOMString.transcode()
Posted by Dean Roddey <dr...@charmedquark.com>.
Read the FAQ. You are mixing runtimes.
--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com
"I'm not sure how I feel about ambivalence"
----- Original Message -----
From: "Rudolf Wiener" <ru...@wiener.at>
To: <xe...@xml.apache.org>
Sent: Sunday, April 01, 2001 2:55 AM
Subject: can't delete char-ptr from DOMString.transcode()
> I am using Xerces 1.4.0 under Win2K with VC6.
>
> The following code snippet asserts in debug mode:
> char* p = myNode.getNodeName().transcode();
> delete p;
> The code is inside a DLL which is being called from an EXE.
>
> The reason for the assert is, I believe, the fact that Xerces was
> first initialized in a different address space. VC's debug
> runtime checks whether memory to be deleted is from the _local_
> heap. If not, it asserts.
>
> Both the EXE and the DLL use Xerces. The EXE builds
> a DOM and serializes it into a string. Then it calls the DLL
> which receives the XML string as a parameter and parses this to
> build a DOM again.
>
> As the DLL might be used by other programs as well (which won't
> use Xerces) I initialize the platform utilities in both the EXE
> and the DLL.
>
> Is there a way to load a second, local, instance of Xerces so
> I could avoid this problem with delete?
>
> Regards
> Rudi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org