summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterconversationpreview.cpp
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2013-09-10 22:12:11 +0300
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2013-09-10 22:12:11 +0300
commit60b20e3bd899198771b3c1b255be042864618cad (patch)
treebd1121b207ce3f753cb573fdf633b6e983b18679 /indra/newview/llfloaterconversationpreview.cpp
parent8a0b7eaaddf9170db5f205d94f680915da13239c (diff)
MAINT-3117 FIXED crash in LLFloaterConversationPreview::showHistory() - optimization
Diffstat (limited to 'indra/newview/llfloaterconversationpreview.cpp')
-rwxr-xr-xindra/newview/llfloaterconversationpreview.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/indra/newview/llfloaterconversationpreview.cpp b/indra/newview/llfloaterconversationpreview.cpp
index dd8bea01b4..5041f4689d 100755
--- a/indra/newview/llfloaterconversationpreview.cpp
+++ b/indra/newview/llfloaterconversationpreview.cpp
@@ -44,7 +44,8 @@ LLFloaterConversationPreview::LLFloaterConversationPreview(const LLSD& session_i
mPageSize(gSavedSettings.getS32("ConversationHistoryPageSize")),
mAccountName(session_id[LL_FCP_ACCOUNT_NAME]),
mCompleteName(session_id[LL_FCP_COMPLETE_NAME]),
- mMutex(NULL)
+ mMutex(NULL),
+ mShowHistory(false)
{
}
@@ -110,35 +111,27 @@ void LLFloaterConversationPreview::setPages(std::list<LLSD>& messages, const std
std::string total_page_num = llformat("/ %d", mCurrentPage+1);
getChild<LLTextBox>("page_num_label")->setValue(total_page_num);
- mChatHistoryLoaded = true;
+ mShowHistory = true;
}
}
void LLFloaterConversationPreview::draw()
{
- if(mChatHistoryLoaded)
+ if(mShowHistory)
{
showHistory();
+ mShowHistory = false;
}
LLFloater::draw();
}
void LLFloaterConversationPreview::onOpen(const LLSD& key)
{
- if(mChatHistoryLoaded)
- {
- showHistory();
- }
+ mShowHistory = true;
}
void LLFloaterConversationPreview::showHistory()
{
- if (!mChatHistoryLoaded)
- {
- return;
- }
- mChatHistoryLoaded = false;
-
// additional protection to avoid changes of mMessages in setPages
LLMutexLock lock(&mMutex);
if(!mMessages.size() || mCurrentPage * mPageSize >= mMessages.size())
@@ -201,10 +194,11 @@ void LLFloaterConversationPreview::showHistory()
void LLFloaterConversationPreview::onMoreHistoryBtnClick()
{
mCurrentPage = (int)(mPageSpinner->getValueF32());
- if (--mCurrentPage < 0)
+ if (!mCurrentPage)
{
return;
}
- showHistory();
+ mCurrentPage--;
+ mShowHistory = true;
}