Click here to Skip to main content
15,867,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting Debug assertion failed in
delete [] pTransCodeString;
line in VS 2017, it works fine in VS 2010.

void CContentHandler::characters(  const   XMLCh* const    chars
								    , const unsigned int    length)
{
	char *pTransCodeString = XMLString::transcode(chars);
	CString tempString(pTransCodeString);
	delete [] pTransCodeString;
	
    m_lastChars += tempString;

}


Is there any other way to write in 2017?


What I have tried:

I have commented
delete [] pTransCodeString;
this code and it is working fine. but i don't want to comment this... as we just doing only migration... this code is used in many places. please suggest.
Posted
Updated 19-May-20 4:32am

Why havent you search for the XMLString documentation???

If you dont like doing research for yourself you should consider stop coding.
 
Share this answer
 
Comments
CPallini 5-May-20 13:22pm    
5.
You should use
XMLString::release(&pTransCodeString);

instead of
delete [] pTransCodeString;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900