Release the correct pointer in implementations of SetOutputErrorBehavior. Bug 295145, patch by Frank Wein <bugzilla@mcsmurf.de>, r=jshin, sr=dbaron

This commit is contained in:
smontagu%smontagu.org 2005-08-29 13:58:56 +00:00
Родитель 303c683415
Коммит b21942d686
5 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -53,9 +53,9 @@ nsUnicodeToSunIndic::SetOutputErrorBehavior(PRInt32 aBehavior,
{
if (aBehavior == kOnError_CallBack && aEncoder == nsnull)
return NS_ERROR_NULL_POINTER;
NS_IF_RELEASE(aEncoder);
NS_IF_RELEASE(mErrEncoder);
mErrEncoder = aEncoder;
NS_IF_ADDREF(aEncoder);
NS_IF_ADDREF(mErrEncoder);
mErrBehavior = aBehavior;
mErrChar = aChar;

Просмотреть файл

@ -148,9 +148,9 @@ nsUnicodeToThaiTTF::SetOutputErrorBehavior(PRInt32 aBehavior,
{
if (aBehavior == kOnError_CallBack && aEncoder == nsnull)
return NS_ERROR_NULL_POINTER;
NS_IF_RELEASE(aEncoder);
NS_IF_RELEASE(mErrEncoder);
mErrEncoder = aEncoder;
NS_IF_ADDREF(aEncoder);
NS_IF_ADDREF(mErrEncoder);
mErrBehavior = aBehavior;
mErrChar = aChar;

Просмотреть файл

@ -168,9 +168,9 @@ nsUnicodeToJamoTTF::SetOutputErrorBehavior(PRInt32 aBehavior,
{
if (aBehavior == kOnError_CallBack && aEncoder == nsnull)
return NS_ERROR_NULL_POINTER;
NS_IF_RELEASE(aEncoder);
NS_IF_RELEASE(mErrEncoder);
mErrEncoder = aEncoder;
NS_IF_ADDREF(aEncoder);
NS_IF_ADDREF(mErrEncoder);
mErrBehavior = aBehavior;
mErrChar = aChar;

Просмотреть файл

@ -524,9 +524,9 @@ nsUnicodeToTamilTTF::SetOutputErrorBehavior(PRInt32 aBehavior,
{
if (aBehavior == kOnError_CallBack && aEncoder == nsnull)
return NS_ERROR_NULL_POINTER;
NS_IF_RELEASE(aEncoder);
NS_IF_RELEASE(mErrEncoder);
mErrEncoder = aEncoder;
NS_IF_ADDREF(aEncoder);
NS_IF_ADDREF(mErrEncoder);
mErrBehavior = aBehavior;
mErrChar = aChar;

Просмотреть файл

@ -571,12 +571,12 @@ NS_IMETHODIMP nsEncoderSupport::SetOutputErrorBehavior(
nsIUnicharEncoder * aEncoder,
PRUnichar aChar)
{
if ((aBehavior == kOnError_CallBack) && (aEncoder == NULL))
if (aBehavior == kOnError_CallBack && aEncoder == nsnull)
return NS_ERROR_NULL_POINTER;
NS_IF_RELEASE(aEncoder);
NS_IF_RELEASE(mErrEncoder);
mErrEncoder = aEncoder;
NS_IF_ADDREF(aEncoder);
NS_IF_ADDREF(mErrEncoder);
mErrBehavior = aBehavior;
mErrChar = aChar;