diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 95183adbe0..a950f51b0e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -139,25 +139,27 @@ namespace OpenSim.Framework.Communications.Cache if (asset.Type == 0) { //Console.WriteLine("which is a texture"); - if (!this.Textures.ContainsKey(asset.FullID)) + if (!Textures.ContainsKey(asset.FullID)) { //texture TextureImage textur = new TextureImage(asset); - this.Textures.Add(textur.FullID, textur); - this._assetServer.StoreAndCommitAsset(asset); + Textures.Add(textur.FullID, textur); + if(!asset.Temporary) + _assetServer.StoreAndCommitAsset(asset); } else { TextureImage textur = new TextureImage(asset); - this.Textures[asset.FullID] = textur; + Textures[asset.FullID] = textur; } } else { - if (!this.Assets.ContainsKey(asset.FullID)) + if (!Assets.ContainsKey(asset.FullID)) { AssetInfo assetInf = new AssetInfo(asset); - this.Assets.Add(assetInf.FullID, assetInf); - this._assetServer.StoreAndCommitAsset(asset); + Assets.Add(assetInf.FullID, assetInf); + if (!asset.Temporary) + _assetServer.StoreAndCommitAsset(asset); } } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d7c1759850..69c3f9e5ab 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -517,6 +517,7 @@ namespace OpenSim.Region.Environment.Scenes asset.Data = data; asset.Name = "terrainImage"; asset.Type = 0; + asset.Temporary = true; commsManager.AssetCache.AddAsset(asset); }