From 9cb76d2b22f71254033060e21810959e30467101f8e2d4067784889be1f98417 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 5 Aug 2025 02:30:28 -0400 Subject: [PATCH] Another hidden vector. --- dw/textblock_linebreaking.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; }