Do better logging of string leaks. Bug 336914, r+sr=darin

git-svn-id: svn://10.0.0.236/trunk@196369 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2006-05-12 03:36:37 +00:00
parent caee2e9858
commit b21642b02c
3 changed files with 34 additions and 5 deletions

View File

@@ -46,7 +46,15 @@ nsTAdoptingString_CharT::operator=( const self_type& str )
if (str.mFlags & F_OWNED)
{
Adopt(str.mData, str.mLength);
// We want to do what Adopt() does, but without actually incrementing
// the Adopt count. Note that we can be a little more straightforward
// about this than Adopt() is, because we know that str.mData is
// non-null. Should we be able to assert that str is not void here?
NS_ASSERTION(str.mData, "String with null mData?");
Finalize();
mData = str.mData;
mLength = str.mLength;
SetDataFlags(F_TERMINATED | F_OWNED);
// Make str forget the buffer we just took ownership of.
new (mutable_str) self_type();