You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by feanoe <fe...@gmail.com> on 2006/08/01 16:43:14 UTC

Re: delete [] crashes for transcode.

domstring dose not have a release function, but anyway, I changed xercis code
and
added a release(char *) function.

the problem is because the memory is allocated in xercis dll and my program
tries to free the memory.
it works ok in VC6 but not work in VC7. how to make it work in VC7 (using
debug build for now)

thanks
-- 
View this message in context: http://www.nabble.com/delete----crashes-for-transcode.-tf2017773.html#a5595756
Sent from the Xerces - C - Users forum at Nabble.com.


Re: delete [] crashes for transcode.

Posted by feanoe <fe...@gmail.com>.
I confirmed it with test code.
thanks!
-- 
View this message in context: http://www.nabble.com/delete----crashes-for-transcode.-tf2017773.html#a5600998
Sent from the Xerces - C - Users forum at Nabble.com.


Re: delete [] crashes for transcode.

Posted by David Bertoni <db...@apache.org>.
feanoe wrote:
> thanks David.
> I'm using "Multi-threaded Debug (/MTd)"
> acctually, I thought the same way with you so, I even downloaded
> xercis's project and rebuild it with same /MTd option, delete [] still not
> work.

You must use the DLL run-time library if you want to use Xerces-C. 
Otherwise, you will see many other delete error like this one, since there 
are multiple heaps in your application.

> so, I added release() to xercis.
> 
> do you think if I change back to "Multi-threaded Debug DLL (/MDd)"  for
> both my project and xercis's project , delete[] will work again?

Yes.

Dave

Re: delete [] crashes for transcode.

Posted by feanoe <fe...@gmail.com>.
thanks David.
I'm using "Multi-threaded Debug (/MTd)"
acctually, I thought the same way with you so, I even downloaded
xercis's project and rebuild it with same /MTd option, delete [] still not
work.
so, I added release() to xercis.

do you think if I change back to "Multi-threaded Debug DLL (/MDd)"  for
both my project and xercis's project , delete[] will work again?

thanks
-- 
View this message in context: http://www.nabble.com/delete----crashes-for-transcode.-tf2017773.html#a5597971
Sent from the Xerces - C - Users forum at Nabble.com.


Re: delete [] crashes for transcode.

Posted by David Bertoni <db...@apache.org>.
feanoe wrote:
> domstring dose not have a release function, but anyway, I changed xercis code
> and
> added a release(char *) function.
> 
> the problem is because the memory is allocated in xercis dll and my program
> tries to free the memory.
> it works ok in VC6 but not work in VC7. how to make it work in VC7 (using
> debug build for now)
> 

delete []  szVal;

is correct.   You should verify that you are building your application 
correctly with VC7.  All of the executables should be using the same 
run-time -- the Debug Multi-threaded DLL run-time in your case.

Dave