From 1de6e0830c9cb500239256e9cab9cb565f8c098a Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Wed, 7 Sep 2016 17:26:07 +0300
Subject: [PATCH] MAINT-6699 FIXED [VOB] Crash in
 LLSnapshotLivePreview::getBigThumbnailImage()

---
 indra/newview/llfloatersnapshot.cpp | 17 +++++++++++++----
 indra/newview/llfloatersnapshot.h   |  2 ++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 664668f2f7c..ff7594a531b 100644
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -1235,14 +1235,14 @@ S32 LLFloaterSnapshot::notify(const LLSD& info)
 	return 0;
 }
 
-void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
+BOOL LLFloaterSnapshotBase::ImplBase::updatePreviewList(bool initialized)
 {
 	LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance<LLFloaterFacebook>("facebook");
 	LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
 	LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance<LLFloaterTwitter>("twitter");
 
-	if (!mFloater && !floater_facebook && !floater_flickr && !floater_twitter)
-		return;
+	if (!initialized && !floater_facebook && !floater_flickr && !floater_twitter)
+		return FALSE;
 
 	BOOL changed = FALSE;
 	LL_DEBUGS() << "npreviews: " << LLSnapshotLivePreview::sList.size() << LL_ENDL;
@@ -1251,8 +1251,13 @@ void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
 	{
 		changed |= LLSnapshotLivePreview::onIdle(*iter);
 	}
+	return changed;
+}
+
 
-	if (mFloater && changed)
+void LLFloaterSnapshotBase::ImplBase::updateLivePreview()
+{
+	if (ImplBase::updatePreviewList(true) && mFloater)
 	{
 		LL_DEBUGS() << "changed" << LL_ENDL;
 		updateControls(mFloater);
@@ -1267,6 +1272,10 @@ void LLFloaterSnapshot::update()
 	{
 		inst->impl->updateLivePreview();
 	}
+	else
+	{
+		ImplBase::updatePreviewList(false);
+	}
 }
 
 // static
diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h
index 4bcfa674fa1..1f303ea4d65 100644
--- a/indra/newview/llfloatersnapshot.h
+++ b/indra/newview/llfloatersnapshot.h
@@ -116,6 +116,8 @@ class LLFloaterSnapshotBase::ImplBase
 	virtual EStatus getStatus() const { return mStatus; }
 	virtual void setNeedRefresh(bool need);
 
+	static BOOL updatePreviewList(bool initialized);
+
 	void setAdvanced(bool advanced) { mAdvanced = advanced; }
 
 	virtual LLSnapshotModel::ESnapshotLayerType getLayerType(LLFloaterSnapshotBase* floater) = 0;
-- 
GitLab