Removed wrong used shared_ptrs 57/90657/3
authorMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Mon, 3 Oct 2016 12:29:55 +0000 (14:29 +0200)
committerMaciej Skrzypkowski <m.skrzypkows@samsung.com>
Mon, 3 Oct 2016 12:47:18 +0000 (05:47 -0700)
[Issue]        http://suprem.sec.samsung.net/jira/browse/TWF-2227
[Problem]      Shared pointers maintained memory which was not owned
               by them.
[Solution]     Removed wrong usage.
[Verify]       Add few bookmarks, check if browser crashes. Previously
               it crashed in second try.

Change-Id: I86b14fac31d2af9ccc99e2bea209df9a1c63f4f4
Signed-off-by: Maciej Skrzypkowski <m.skrzypkows@samsung.com>
services/BookmarkFlowUI/BookmarkFlowUI.cpp
services/BookmarkFlowUI/BookmarkFlowUI.h

index 45800e032eab101e6e6a800b07d9bb7d9a34c753..0f9ed74442bdeee0b02aa79eb051fbf63b5f593b 100755 (executable)
@@ -244,7 +244,7 @@ void BookmarkFlowUI::fillGenlist()
     EntryData *titleEntryData = new EntryData();
     titleEntryData->category = _("IDS_BR_BODY_TITLE");
     titleEntryData->entry = m_title;
-    titleEntryData->bookmarkFlowUI.reset(this);
+    titleEntryData->bookmarkFlowUI = this;
 
     m_title_entry = elm_genlist_item_append(m_genlist, m_entry_item_class, titleEntryData, nullptr,
         ELM_GENLIST_ITEM_NONE, nullptr, titleEntryData);
@@ -254,7 +254,7 @@ void BookmarkFlowUI::fillGenlist()
         EntryData *urlEntryData = new EntryData();
         urlEntryData->category = _("IDS_BR_BODY_ADDBOOKMARKURL");
         urlEntryData->entry = m_url;
-        urlEntryData->bookmarkFlowUI.reset(this);
+        urlEntryData->bookmarkFlowUI = this;
         m_url_entry = elm_genlist_item_append(m_genlist, m_entry_item_class, urlEntryData, nullptr,
             ELM_GENLIST_ITEM_NONE, nullptr, urlEntryData);
     }
@@ -266,7 +266,7 @@ void BookmarkFlowUI::fillGenlist()
     FolderData *folderData = new FolderData();
     folderData->name = m_bookmarkItem->getTitle();
     folderData->folder_id = m_bookmarkItem->getId();
-    folderData->bookmarkFlowUI.reset(this);
+    folderData->bookmarkFlowUI = this;
 
     //Add folder picker
     elm_genlist_item_append(m_genlist, m_folder_item_class, folderData, nullptr, ELM_GENLIST_ITEM_NONE,
index b3c89953fd2b77684d3a9cae77498351a0890230..2fe65366db6287abebeb6cdd0bbabaad3109607c 100644 (file)
@@ -82,18 +82,18 @@ private:
     struct FolderData {
         std::string name;
         unsigned int folder_id;
-        std::shared_ptr<BookmarkFlowUI> bookmarkFlowUI;
+        BookmarkFlowUI* bookmarkFlowUI;
     };
 
     struct EntryData {
         std::string category;
         std::string entry;
-        std::shared_ptr<BookmarkFlowUI> bookmarkFlowUI;
+        BookmarkFlowUI* bookmarkFlowUI;
     };
 
     struct ObjectData {
         Evas_Object* object;
-        std::shared_ptr<BookmarkFlowUI> bookmarkFlowUI;
+        BookmarkFlowUI* bookmarkFlowUI;
     };
 
     Evas_Object* createBookmarkFlowLayout();