From: SinJae Lee Date: Mon, 14 Jan 2019 03:35:07 +0000 (+0900) Subject: Using delete[] for pointer that created with new[] X-Git-Tag: dali_1.4.9~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=204a8ff506d634e38af6838009f55fa5e07118fe;hp=b61b95bc078c3f67d0a43a21fcb78bd334d03f32 Using delete[] for pointer that created with new[] ==3825== Thread 1: ==3825== Mismatched free() / delete / delete [] ==3825== at 0x484739C: operator delete(void*) (vg_replace_malloc.c:575) ==3825== by 0x6AA5BFF: Dali::Toolkit::Text::FreeFontFamilyNames(Dali::Vector&) (logical-model-impl.cpp:41) ==3825== by 0x6AAA8F7: Dali::Toolkit::Text::Controller::SetText(std::__cxx11::basic_string, std::allocator > const&) (text-controller.cpp:501) ==3825== by 0x6A8FE63: Dali::Toolkit::Internal::TextLabel::SetProperty(Dali::BaseObject*, int, Dali::Property::Value const&) (text-label-impl.cpp:183) ==3825== by 0x49B0995: Dali::Internal::TypeInfo::SetProperty(Dali::BaseObject*, int, Dali::Property::Value const&) const (type-info-impl.cpp:775) ==3825== by 0x49ABA7D: Dali::Internal::Object::SetProperty(int, Dali::Property::Value const&) (object-impl.cpp:441) ==3825== Address 0x11461530 is 0 bytes inside a block of size 5 alloc'd ==3825== at 0x48466E8: operator new[](unsigned int) (vg_replace_malloc.c:416) ==3825== by 0x6AA6CD3: Dali::Toolkit::Text::ProcessFontTag(Dali::Toolkit::Text::Tag const&, Dali::Toolkit::Text::FontDescriptionRun&) (markup-processor-font.cpp:62) ==3825== by 0x6AA6801: Dali::Toolkit::Text::ProcessMarkupString(std::__cxx11::basic_string, std::allocator > const&, Dali::Toolkit::Text::MarkupProcessData&) (markup-processor.cpp:633) ==3825== by 0x6AAA95D: Dali::Toolkit::Text::Controller::SetText(std::__cxx11::basic_string, std::allocator > const&) (text-controller.cpp:529) ==3825== by 0x6A8FE63: Dali::Toolkit::Internal::TextLabel::SetProperty(Dali::BaseObject*, int, Dali::Property::Value const&) (text-label-impl.cpp:183) ==3825== by 0x49B0995: Dali::Internal::TypeInfo::SetProperty(Dali::BaseObject*, int, Dali::Property::Value const&) const (type-info-impl.cpp:775) Change-Id: I2d04f99bbb37a635f0b72929ce8ce9915e124359 --- diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp index 6fbabb1..66c6d89 100755 --- a/dali-toolkit/internal/text/logical-model-impl.cpp +++ b/dali-toolkit/internal/text/logical-model-impl.cpp @@ -38,7 +38,7 @@ void FreeFontFamilyNames( Vector& fontDescriptionRuns ) it != endIt; ++it ) { - delete (*it).familyName; + delete[] (*it).familyName; } fontDescriptionRuns.Clear();