diff options
author | Sean Dague | 2008-06-30 15:05:30 +0000 |
---|---|---|
committer | Sean Dague | 2008-06-30 15:05:30 +0000 |
commit | 721988adcd5a38607cb0ff5495f2984e7efb9761 (patch) | |
tree | 1f69931d87bb097014c4ef901436871cd0f85df6 /OpenSim | |
parent | Mantis#1637. Thank you kindly, Melanie for a patch that: (diff) | |
download | opensim-SC-721988adcd5a38607cb0ff5495f2984e7efb9761.zip opensim-SC-721988adcd5a38607cb0ff5495f2984e7efb9761.tar.gz opensim-SC-721988adcd5a38607cb0ff5495f2984e7efb9761.tar.bz2 opensim-SC-721988adcd5a38607cb0ff5495f2984e7efb9761.tar.xz |
add the ability to cherry pick expire something from the asset
cache. Bandaid until we rethink the caches a bit more.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/AssetCache.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 2c51160..95af28b 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs | |||
@@ -382,6 +382,30 @@ namespace OpenSim.Framework.Communications.Cache | |||
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | /// <summary> | ||
386 | /// Allows you to clear a specific asset by uuid out | ||
387 | /// of the asset cache. This is needed because the osdynamic | ||
388 | /// texture code grows the asset cache without bounds. The | ||
389 | /// real solution here is a much better cache archicture, but | ||
390 | /// this is a stop gap measure until we have such a thing. | ||
391 | /// </summary> | ||
392 | |||
393 | public void ExpireAsset(LLUUID uuid) | ||
394 | { | ||
395 | // uuid is unique, so no need to worry about it showing up | ||
396 | // in the 2 caches differently. Also, locks are probably | ||
397 | // needed in all of this, or move to synchronized non | ||
398 | // generic forms for Dictionaries. | ||
399 | if (Textures.ContainsKey(uuid)) | ||
400 | { | ||
401 | Textures.Remove(uuid); | ||
402 | } | ||
403 | else if (Assets.ContainsKey(uuid)) | ||
404 | { | ||
405 | Assets.Remove(uuid); | ||
406 | } | ||
407 | } | ||
408 | |||
385 | // See IAssetReceiver | 409 | // See IAssetReceiver |
386 | public void AssetReceived(AssetBase asset, bool IsTexture) | 410 | public void AssetReceived(AssetBase asset, bool IsTexture) |
387 | { | 411 | { |