зеркало из https://github.com/mozilla/pjs.git
Avoid calling Copy from operator= if we are just resetting the nsXPIDLString. So now it is safe to reset an nsXPIDLCString or nsXPIDLString by setting it to null. r=waterson,a=jevering
This commit is contained in:
Родитель
c43b419d96
Коммит
c6eb1678bb
|
@ -128,7 +128,8 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
|
|||
if (mBufOwner && mBuf)
|
||||
XPIDL_FREE(mBuf);
|
||||
|
||||
mBuf = Copy(aCString);
|
||||
if (aCString)
|
||||
mBuf = Copy(aCString);
|
||||
mBufOwner = PR_TRUE;
|
||||
|
||||
return *this;
|
||||
|
|
|
@ -128,7 +128,8 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
|
|||
if (mBufOwner && mBuf)
|
||||
XPIDL_FREE(mBuf);
|
||||
|
||||
mBuf = Copy(aCString);
|
||||
if (aCString)
|
||||
mBuf = Copy(aCString);
|
||||
mBufOwner = PR_TRUE;
|
||||
|
||||
return *this;
|
||||
|
|
|
@ -128,7 +128,8 @@ nsXPIDLCString& nsXPIDLCString::operator =(const char* aCString)
|
|||
if (mBufOwner && mBuf)
|
||||
XPIDL_FREE(mBuf);
|
||||
|
||||
mBuf = Copy(aCString);
|
||||
if (aCString)
|
||||
mBuf = Copy(aCString);
|
||||
mBufOwner = PR_TRUE;
|
||||
|
||||
return *this;
|
||||
|
|
Загрузка…
Ссылка в новой задаче