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();