Re: C++ std::string tries to free() a not allocated pointer ?
Re: C++ std::string tries to free() a not allocated pointer ?
- Subject: Re: C++ std::string tries to free() a not allocated pointer ?
- From: Howard Moon <email@hidden>
- Date: Thu, 19 Nov 2009 07:41:56 -0800
On Nov 19, 2009, at 7:26 AM, Paul Sanders wrote:
What does your destructor do? Your copy constructors / assignment
operators
appear to copy the pointer, rather than making a copy of the data
pointed
to, so perhaps you end up freeing the pointer twice (once for each
SQLString
object destroyed).
That would be true if realStr were a char*. But it's defined as a
std::string, so its assignment operator is used, which would perform
the string copy properly.
-Howard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden