Fix crash in Chooser when switching between TabNavigator pages. 59/107359/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 27 Dec 2016 15:18:04 +0000 (17:18 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Tue, 27 Dec 2016 15:18:47 +0000 (17:18 +0200)
Changed navigateTo() to determine whether view is already added by checking
the presence of the page instead of parent navigator which is impossible to
find from non-current TabNavigator page.

Change-Id: I73622706fe2e3b355741b970a7c3a2cc20c517d7
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-apps-common/src/Ui/Navigator.cpp
lib-apps-common/src/Ui/View.cpp

index bc294da..ec581ad 100644 (file)
@@ -70,11 +70,12 @@ void Navigator::navigateTo(View *view)
                return;
        }
 
-       if (!view->getNavigator()) {
+       NavigatorPage *page = view->getPage();
+       if (!page) {
                addView(view);
+               page = view->getPage();
        }
 
-       NavigatorPage *page = view->getPage();
        if (page != m_CurrentPage) {
                navigateToPage(page);
        }
index dbbecbf..0d48579 100644 (file)
@@ -48,10 +48,6 @@ int View::getRotation() const
 
 void View::onNavigatorAttached(NavigatorPage *page)
 {
-       if (m_Page) {
-               m_Page->close();
-       }
-
        m_Page = page;
        onPageAttached(m_Page);
 }