diff options
| -rwxr-xr-x | indra/newview/llfloaterconversationpreview.cpp | 17 | 
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp index 4a85160f95..dd8bea01b4 100755 --- a/indra/newview/llfloaterconversationpreview.cpp +++ b/indra/newview/llfloaterconversationpreview.cpp @@ -91,12 +91,11 @@ BOOL LLFloaterConversationPreview::postBuild()  	mPageSpinner->setMinValue(1);  	mPageSpinner->set(1);  	mPageSpinner->setEnabled(false); -	mChatHistoryLoaded = false;  	LLLogChat::startChatHistoryThread(file, load_params);  	return LLFloater::postBuild();  } -void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages,const std::string& file_name) +void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages, const std::string& file_name)  {  	if(file_name == mChatHistoryFileName)  	{ @@ -120,7 +119,6 @@ void LLFloaterConversationPreview::draw()  	if(mChatHistoryLoaded)  	{  		showHistory(); -		mChatHistoryLoaded = false;  	}  	LLFloater::draw();  } @@ -135,10 +133,15 @@ void LLFloaterConversationPreview::onOpen(const LLSD& key)  void LLFloaterConversationPreview::showHistory()  { -	// additional protection to avoid changes of mMessages in setPages() -	LLMutexLock lock(&mMutex); +	if (!mChatHistoryLoaded) +	{ +		return; +	} +	mChatHistoryLoaded = false; -	if (!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size()) +	// additional protection to avoid changes of mMessages in setPages +	LLMutexLock lock(&mMutex); +	if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size())  	{  		return;  	} @@ -147,7 +150,7 @@ void LLFloaterConversationPreview::showHistory()  	std::ostringstream message;  	std::list<LLSD>::const_iterator iter = mMessages.begin();  	std::advance(iter, mCurrentPage * mPageSize); - +	  	for (int msg_num = 0; iter != mMessages.end() && msg_num < mPageSize; ++iter, ++msg_num)  	{  		LLSD msg = *iter;  | 
