From b486f6a72c94468f4667d364636d56ea545be188 Mon Sep 17 00:00:00 2001
From: Nyx Linden <nyx@lindenlab.com>
Date: Fri, 11 Oct 2013 16:52:45 -0400
Subject: [PATCH] SH-4458 SH-3652 FIX Pants flare does not load properly upon
 an avatar returning

Viewer added a new callback when the avatar returned without resetting the
timer for last reference to the saved raw image. This created a time window
in which new callbacks could get cleared out due to the raw image getting destroyed.

Since the callback was removed, pants flare was not properly applied. Appears
to be working now.
---
 indra/newview/llviewertexture.cpp | 1 +
 indra/newview/llvoavatar.cpp      | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 5330c4da861..5ab628ab2c1 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -2169,6 +2169,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call
 		}
 	}
 	mLastCallBackActiveTime = sCurrentTime ;
+        mLastReferencedSavedRawImageTime = sCurrentTime;
 }
 
 void LLViewerFetchedTexture::clearCallbackEntryList()
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 93247a3625b..110f5713977 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6316,6 +6316,8 @@ void LLVOAvatar::updateMeshTextures()
 				// we'll consider it loaded and use it (rather than
 				// doing compositing).
 				useBakedTexture( baked_img->getID() );
+                                mLoadedCallbacksPaused |= !isVisible();
+                                checkTextureLoading();
 			}
 			else
 			{
@@ -6331,6 +6333,7 @@ void LLVOAvatar::updateMeshTextures()
 
                                // this could add paused texture callbacks
                                mLoadedCallbacksPaused |= paused; 
+                               checkTextureLoading();
 			}
 		}
 		else if (layerset && isUsingLocalAppearance())
-- 
GitLab