X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/samples/layout/paragraph.cpp?ds=inline diff --git a/icuSources/samples/layout/paragraph.cpp b/icuSources/samples/layout/paragraph.cpp index 65d3e368..9a92b587 100644 --- a/icuSources/samples/layout/paragraph.cpp +++ b/icuSources/samples/layout/paragraph.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * - * Copyright (C) 1999-2007, International Business Machines + * Copyright (C) 1999-2015, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -115,6 +115,7 @@ Paragraph::Paragraph(const LEUnicode chars[], int32_t charCount, const FontRuns paragraphLayout = new ParagraphLayout(pStart, pEnd - pStart, &fr, NULL, NULL, locales, fParagraphLevel, FALSE, status); if (LE_FAILURE(status)) { + delete paragraphLayout; break; // return? something else? } @@ -163,8 +164,12 @@ Paragraph::~Paragraph() delete /*(LineInfo *)*/ fLines[line]; } + for (le_int32 paragraph = 0; paragraph < fParagraphCount; paragraph += 1) { + delete fParagraphLayout[paragraph]; + } + LE_DELETE_ARRAY(fLines); - delete fParagraphLayout; + LE_DELETE_ARRAY(fParagraphLayout); LE_DELETE_ARRAY(fChars); }