+ Fixed a race condition where the second packet of an image download would come before the initial packet (where the initial packet caused the image buffer to be initialized)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@482 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Michael Cortez
2006-11-03 01:02:08 +00:00
parent ca7ebd744f
commit 0eb4ab0b7f
4 changed files with 29 additions and 11 deletions

View File

@@ -72,7 +72,7 @@ namespace IA_TestAsyncImage
{
foreach (TextureEntryFace tef in avatar.Textures.FaceTextures.Values)
{
if (imgManager.isCachedImage(avatar.FirstLifeImage) == false)
if (imgManager.isCachedImage(tef.TextureID) == false)
{
imgManager.RequestImageAsync(tef.TextureID);
}
@@ -136,14 +136,20 @@ namespace IA_TestAsyncImage
}
else
{
Console.WriteLine("Finished ( " + data.Length + "): " + ImageID);
if (data == null)
{
Console.WriteLine("Image Data is null: " + ImageID);
}
else
{
Console.WriteLine("Finished ( " + data.Length + "): " + ImageID);
String filename = Path.Combine(OutputDirectory, ImageID.ToStringHyphenated()) + ".tif";
TiffJob tj = new TiffJob( filename, data );
Thread t = new Thread(tj.RunMe);
t.Start();
String filename = Path.Combine(OutputDirectory, ImageID.ToStringHyphenated()) + ".tif";
TiffJob tj = new TiffJob(filename, data);
Thread t = new Thread(tj.RunMe);
t.Start();
}
}
}