From e0f1f3b4d1860143070d15501e19546680ed664a Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Tue, 27 Oct 2015 09:49:01 -0500 Subject: Move reloading of theme outside of the action thread Reloading the GUI while the GUI is running and rendering is very dangerous as we may be deleting GUI resources before or while we are trying to render those same items. This change will allow us to safely load new resources and delete the old ones. Fixed a double free situation that was causing a crash on every other theme reload. Clear parsed xml documents when we are done loading the theme instead of keeping them in memory for the life of the theme to help save a little memory. Store starting page so that if we request a reload, we can enter the theme at the same starting point, which may come in handy if we allow for language selection on alternate starting pages such as the decrypt prompt or the system read only prompt. Change-Id: I45a7e3fb3daeefac56d70f8d4936938eb1244b99 --- gui/gui.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gui/gui.cpp') diff --git a/gui/gui.cpp b/gui/gui.cpp index a5ac33e86..31b61be6d 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -663,6 +663,8 @@ static int runPages(const char *page_name, const int stop_on_page_done) int ret = PageManager::Update(); if (ret == 0) ++idle_frames; + else if (ret == -2) + break; // Theme reload failure else idle_frames = 0; // due to possible animation objects, we need to delay activating the input timeout -- cgit v1.2.3