remove a DynamicTexture leak, make it actually return the new texture ID to ossl, do delete previus texture from local cache if temporary,at least on same cases... but still very broken..

0.9.0-post-fixes
UbitUmarov 2017-06-24 05:22:02 +01:00
parent ae4266916c
commit 72db6f76b5
1 changed files with 16 additions and 9 deletions

View File

@ -135,16 +135,15 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
m_reuseableDynamicTextures.Store(
GenerateReusableTextureKey(texture.InputCommands, texture.InputParams), newTextureID);
}
updater.newTextureID = newTextureID;
}
}
if (updater.UpdateTimer == 0)
{
lock (Updaters)
if (updater.UpdateTimer == 0)
{
if (!Updaters.ContainsKey(updater.UpdaterID))
lock (Updaters)
{
Updaters.Remove(updater.UpdaterID);
if (Updaters.ContainsKey(updater.UpdaterID))
Updaters.Remove(updater.UpdaterID);
}
}
}
@ -213,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
}
RenderPlugins[contentType].AsyncConvertUrl(updater.UpdaterID, url, extraParams);
return updater.UpdaterID;
return updater.newTextureID;
}
return UUID.Zero;
}
@ -314,7 +313,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
updater.UpdatePart(part, (UUID)objReusableTextureUUID);
}
return updater.UpdaterID;
return updater.newTextureID;
}
private string GenerateReusableTextureKey(string data, string extraParams)
@ -411,6 +410,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
public int Face;
public int Disp;
public string Url;
public UUID newTextureID;
public DynamicTextureUpdater()
{
@ -445,7 +445,14 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
{
try
{
Primitive.TextureEntryFace texface = tmptex.CreateFace((uint)Face);
Primitive.TextureEntryFace texface = tmptex.GetFace((uint)Face);
if(texface == null)
tmptex.GetFace((uint)Face);
else
{
if(texface.TextureID != null && texface.TextureID != UUID.Zero)
oldID = texface.TextureID;
}
texface.TextureID = textureID;
tmptex.FaceTextures[Face] = texface;
}