From 6f7920178e3e96000c81df9171c201e3e2a28378 Mon Sep 17 00:00:00 2001 From: Sergei Kobec Date: Thu, 28 Apr 2016 12:45:19 +0300 Subject: [PATCH] Fixed memory leak of Number objects in Person Change-Id: I950a1594ad131e3449f20d5252742cf66d33daab Signed-off-by: Sergei Kobec --- lib-contacts/inc/Contacts/List/ListView.h | 1 - lib-contacts/src/Contacts/List/Model/Person.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib-contacts/inc/Contacts/List/ListView.h b/lib-contacts/inc/Contacts/List/ListView.h index 6d9ce5a..02da919 100644 --- a/lib-contacts/inc/Contacts/List/ListView.h +++ b/lib-contacts/inc/Contacts/List/ListView.h @@ -24,7 +24,6 @@ #include "Ux/SelectView.h" #include "Utils/UniString.h" - #include #include diff --git a/lib-contacts/src/Contacts/List/Model/Person.cpp b/lib-contacts/src/Contacts/List/Model/Person.cpp index 0eafaee..3ed522a 100644 --- a/lib-contacts/src/Contacts/List/Model/Person.cpp +++ b/lib-contacts/src/Contacts/List/Model/Person.cpp @@ -79,6 +79,9 @@ Person::Person(contacts_record_h record) Person::~Person() { + for (auto &&number : m_Numbers) { + delete number; + } contacts_record_destroy(m_NameRecord, true); contacts_record_destroy(m_Record, true); } -- 2.7.4