From 15576979a09e7fbf9baad38e6fefba0e2bbb4ee9 Mon Sep 17 00:00:00 2001 From: Kadah Date: Sun, 24 Apr 2011 17:05:10 -0700 Subject: [PATCH] FIRE-905: Force cache clear when ever J2C engine changes --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f8932cedfd..cb06f3914f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13541,5 +13541,16 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + LastJ2CVersion + + Comment + Last used J2C engine version + Persist + 1 + Type + String + Value + + diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2bbdeb04e8..1998fd2588 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3475,6 +3475,14 @@ bool LLAppViewer::initCache() gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); mPurgeCache = true; } + + // If the J2C has changed since the last run, clear the cache + const std::string j2c_info = LLImageJ2C::getEngineInfo(); + if (j2c_info != gSavedSettings.getString("LastJ2CVersion")) + { + mPurgeCache = true; + } + gSavedSettings.setString("LastJ2CVersion", j2c_info); // We have moved the location of the cache directory over time. migrateCacheDirectory();