mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 14:55:39 +00:00
Rename the memory allocating versions to make prev error less likely
The behavior is different enough that these shouldn't be overloaded with the non-allocating verions. Also makes it more obvious what is going on to the caller.
This commit is contained in:
parent
d669eb6ee7
commit
fcf52fb5e0
9 changed files with 17 additions and 17 deletions
|
|
@ -346,7 +346,7 @@ class String::StringData : protected StringDataImpl
|
|||
{
|
||||
// Do this atomically to protect interned strings.
|
||||
|
||||
UTF16* utf16 = convertUTF8toUTF16( mData );
|
||||
UTF16* utf16 = createUTF16string( mData );
|
||||
if( !dCompareAndSwap( mUTF16,( UTF16* ) NULL, utf16 ) )
|
||||
delete [] utf16;
|
||||
}
|
||||
|
|
@ -580,7 +580,7 @@ String::String(const UTF16 *str)
|
|||
|
||||
if( str && str[ 0 ] )
|
||||
{
|
||||
UTF8* utf8 = convertUTF16toUTF8( str );
|
||||
UTF8* utf8 = createUTF8string( str );
|
||||
U32 len = dStrlen( utf8 );
|
||||
_string = new ( len ) StringData( utf8 );
|
||||
delete [] utf8;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ protected:
|
|||
: mData( str ), mLength( str ? dStrlen( str ) : 0 ), mUTF16( NULL )
|
||||
{
|
||||
if( str )
|
||||
mUTF16 = convertUTF8toUTF16( mData );
|
||||
mUTF16 = createUTF16string( mData );
|
||||
}
|
||||
~StrTest()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue