Fixed crash on waking up on migration in background

This commit is contained in:
r.kuznetsov 2016-04-05 20:39:54 +03:00 committed by Alex Zolotarev
parent 7a8bb828fd
commit be1e163758
2 changed files with 8 additions and 2 deletions

View file

@ -269,7 +269,8 @@ void Framework::Migrate(bool keepDownloaded)
// framework (i.e. m_infoGetter) which are reinitialized during migration process.
// If we do not suspend drape, it tries to access framework fields (i.e. m_infoGetter) which are null
// while migration is performed.
SetRenderingEnabled(false);
if (m_drapeEngine && m_isRenderingEnabled)
m_drapeEngine->SetRenderingEnabled(false);
m_searchEngine.reset();
m_infoGetter.reset();
TCountriesVec existedCountries;
@ -280,7 +281,8 @@ void Framework::Migrate(bool keepDownloaded)
InitCountryInfoGetter();
InitSearchEngine();
RegisterAllMaps();
SetRenderingEnabled(true);
if (m_drapeEngine && m_isRenderingEnabled)
m_drapeEngine->SetRenderingEnabled(true);
InvalidateRect(MercatorBounds::FullRect());
}
@ -289,6 +291,7 @@ Framework::Framework()
, m_bmManager(*this)
, m_fixedSearchResults(0)
, m_lastReportedCountry(kInvalidCountryId)
, m_isRenderingEnabled(true)
{
// Restore map style before classificator loading
int mapStyle;
@ -1529,6 +1532,7 @@ void Framework::DestroyDrapeEngine()
void Framework::SetRenderingEnabled(bool enable)
{
m_isRenderingEnabled = enable;
if (m_drapeEngine)
m_drapeEngine->SetRenderingEnabled(enable);
}

View file

@ -133,6 +133,8 @@ protected:
BookmarkManager m_bmManager;
bool m_isRenderingEnabled;
/// This function will be called by m_storage when latest local files
/// is downloaded.
void OnCountryFileDownloaded(storage::TCountryId const & countryId, storage::Storage::TLocalFilePtr const localFile);