From a74869abf6522d19c9e3dc416e72a2580a824628 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Mon, 21 Jan 2008 17:35:02 +0000 Subject: [PATCH] ICU-5955 Fix a few crashes under error conditions. X-SVN-Rev: 23277 --- icu4c/source/i18n/ucln_in.h | 15 ++++++++------- icu4c/source/test/intltest/calcasts.cpp | 1 - icu4c/source/test/intltest/regcoll.cpp | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/icu4c/source/i18n/ucln_in.h b/icu4c/source/i18n/ucln_in.h index fa4f45202c..58d990caa4 100644 --- a/icu4c/source/i18n/ucln_in.h +++ b/icu4c/source/i18n/ucln_in.h @@ -1,7 +1,7 @@ /* ****************************************************************************** * * -* Copyright (C) 2001-2006, International Business Machines * +* Copyright (C) 2001-2008, International Business Machines * * Corporation and others. All Rights Reserved. * * * ****************************************************************************** @@ -22,7 +22,8 @@ /* Please keep the order of enums declared in same order -as the functions are suppose to be called. */ +as the functions are suppose to be called. +It's usually best to have child dependencies called first. */ typedef enum ECleanupI18NType { UCLN_I18N_START = -1, UCLN_I18N_TRANSLITERATOR, @@ -32,17 +33,17 @@ typedef enum ECleanupI18NType { UCLN_I18N_HEBREW_CALENDAR, UCLN_I18N_ASTRO_CALENDAR, UCLN_I18N_CALENDAR, - UCLN_I18N_NUMFMT, - UCLN_I18N_CURRENCY, + UCLN_I18N_ZONEMETA, + UCLN_I18N_ZSFORMAT, UCLN_I18N_TIMEZONE, + UCLN_I18N_PLURAL_RULE, + UCLN_I18N_CURRENCY, + UCLN_I18N_NUMFMT, UCLN_I18N_USEARCH, UCLN_I18N_COLLATOR, UCLN_I18N_UCOL, UCLN_I18N_UCOL_BLD, UCLN_I18N_CSDET, - UCLN_I18N_ZONEMETA, - UCLN_I18N_ZSFORMAT, - UCLN_I18N_PLURAL_RULE, UCLN_I18N_COUNT /* This must be last */ } ECleanupI18NType; diff --git a/icu4c/source/test/intltest/calcasts.cpp b/icu4c/source/test/intltest/calcasts.cpp index 5246808b19..63172326e9 100644 --- a/icu4c/source/test/intltest/calcasts.cpp +++ b/icu4c/source/test/intltest/calcasts.cpp @@ -173,7 +173,6 @@ void CalendarCaseTest::IslamicCivil() if (fmt == NULL) { dataerrln("Error calling DateFormat::createDateInstance"); delete c; - delete fmt; return; } diff --git a/icu4c/source/test/intltest/regcoll.cpp b/icu4c/source/test/intltest/regcoll.cpp index 074f678be2..c5b03b2a91 100644 --- a/icu4c/source/test/intltest/regcoll.cpp +++ b/icu4c/source/test/intltest/regcoll.cpp @@ -812,6 +812,7 @@ void CollationRegressionTest::Test4124632(/* char* par */) { errln("Failed to create collator for Locale::JAPAN"); delete coll; + return; } static const UChar test[] = {0x41, 0x0308, 0x62, 0x63, 0}; @@ -844,6 +845,7 @@ void CollationRegressionTest::Test4132736(/* char* par */) { errln("Failed to create a collator for Locale::getFrance()"); delete c; + return; } static const UChar test1[][CollationRegressionTest::MAX_TOKEN_LEN] =