From 26fb00ec6d8dec52a4ec4c0f194a9da6f310b7e3 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Thu, 6 Apr 2017 16:59:34 +0200 Subject: loplugin:useuniqueptr Change-Id: I1499ea7316811892c014592ef2bb6e431543af1a --- i18npool/source/collator/gencoll_rule.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'i18npool/source/collator') diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx index 7ca3e935e5f2..7d795b5af079 100644 --- a/i18npool/source/collator/gencoll_rule.cxx +++ b/i18npool/source/collator/gencoll_rule.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -112,7 +113,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) //UCollator *coll = ucol_openRules(Obuf.getStr(), Obuf.getLength(), UCOL_OFF, // UCOL_DEFAULT_STRENGTH, &parseError, &status); - RuleBasedCollator *coll = new RuleBasedCollator(reinterpret_cast(Obuf.getStr()), status); + auto coll = o3tl::make_unique(reinterpret_cast(Obuf.getStr()), status); if (U_SUCCESS(status)) { std::vector data; @@ -131,8 +132,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) printf("\nRule parsing error\n"); } - delete coll; - return U_SUCCESS(status) ? 0 : 1; } // End of main -- cgit