FIRE-905: Force cache clear when ever J2C engine changes

meow-7.2.2
Kadah 2011-04-24 17:05:10 -07:00
parent 9f6ddff6f7
commit 15576979a0
2 changed files with 19 additions and 0 deletions

View File

@ -13541,5 +13541,16 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<key>LastJ2CVersion</key>
<map>
<key>Comment</key>
<string>Last used J2C engine version</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string></string>
</map>
</map>
</llsd>

View File

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