diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index 1580766..7d80e9e 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -1421,9 +1421,9 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1) if (numBreaks > 0) { Word origWord = *hyphenatedWord; - core::Requisition *wordSize = new core::Requisition[numBreaks + 1]; + std::vector< core::Requisition > wordSize( numBreaks + 1 ); calcTextSizes (origWord.content.text, strlen (origWord.content.text), - origWord.style, numBreaks, breakPos, wordSize); + origWord.style, numBreaks, breakPos, wordSize.data()); PRINTF ("[%p] %d words ...\n", this, words->size ()); words->insert (wordIndex, numBreaks); @@ -1506,7 +1506,6 @@ int Textblock::hyphenateWord (int wordIndex, int *addIndex1) origWord.spaceStyle->unref (); free (breakPos); - delete[] wordSize; } else { words->getRef(wordIndex)->flags &= ~Word::CAN_BE_HYPHENATED; }