Bug 481697 - TextRunWordCache::MakeTextRun: Mismatched free() / delete / delete []; r=vladimir
authorRobert O'Callahan <roc@ocallahan.org>
Sun, 08 Mar 2009 10:39:00 +0100
changeset 25836 2fed1d788328108c822993e6bad157add3713476
parent 25835 6874f88f06a72f160258ad3829862bf889d257ad
child 25837 537eccc6c218015a1977e07df16e3872ee359e1c
push idunknown
push userunknown
push dateunknown
reviewersvladimir
bugs481697
milestone1.9.2a1pre
Bug 481697 - TextRunWordCache::MakeTextRun: Mismatched free() / delete / delete []; r=vladimir
gfx/thebes/src/gfxTextRunWordCache.cpp
--- a/gfx/thebes/src/gfxTextRunWordCache.cpp
+++ b/gfx/thebes/src/gfxTextRunWordCache.cpp
@@ -608,17 +608,17 @@ TextRunWordCache::MakeTextRun(const PRUn
                 seenDigitToModify = PR_TRUE;
         }
         if (IsWordBoundary(ch)) {
             if (seenDigitToModify) {
                 // the word included at least one digit that is modified by the current
                 // bidi.numerals setting, so we must not use the cache for this word;
                 // instead, we'll create a new textRun and a DeferredWord entry pointing to it
                 PRUint32 length = i - wordStart;
-                nsAutoPtr<PRUnichar> numString;
+                nsAutoArrayPtr<PRUnichar> numString;
                 numString = new PRUnichar[length];
                 for (PRUint32 j = 0; j < length; ++j) {
                     numString[j] = HandleNumberInChar(aText[wordStart+j],
                                                       !!(j > 0 ?
                                                           IS_ARABIC_CHAR(numString[j-1]) :
                                                           (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR)),
                                                       mBidiNumeral);
                 }
@@ -728,17 +728,17 @@ TextRunWordCache::MakeTextRun(const PRUi
             if (HandleNumberInChar(ch, i == 0 && (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR),
                                    mBidiNumeral) != ch)
                 seenDigitToModify = PR_TRUE;
         }
         if (IsWordBoundary(ch)) {
             if (seenDigitToModify) {
                 // see parallel code in the 16-bit method above
                 PRUint32 length = i - wordStart;
-                nsAutoPtr<PRUnichar> numString;
+                nsAutoArrayPtr<PRUnichar> numString;
                 numString = new PRUnichar[length];
                 for (PRUint32 j = 0; j < length; ++j) {
                     numString[j] = HandleNumberInChar(aText[wordStart+j],
                                                       !!(j > 0 ?
                                                           IS_ARABIC_CHAR(numString[j-1]) :
                                                           (aFlags & gfxTextRunWordCache::TEXT_INCOMING_ARABICCHAR)),
                                                       mBidiNumeral);
                 }