diff options
author | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2013-09-10 22:12:11 +0300 |
---|---|---|
committer | maksymsproductengine <maksymsproductengine@lindenlab.com> | 2013-09-10 22:12:11 +0300 |
commit | 60b20e3bd899198771b3c1b255be042864618cad (patch) | |
tree | bd1121b207ce3f753cb573fdf633b6e983b18679 /indra/newview | |
parent | 8a0b7eaaddf9170db5f205d94f680915da13239c (diff) |
MAINT-3117 FIXED crash in LLFloaterConversationPreview::showHistory() - optimization
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfloaterconversationpreview.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llfloaterconversationpreview.h | 2 |
2 files changed, 10 insertions, 16 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; } diff --git a/indra/newview/llfloaterconversationpreview.h b/indra/newview/llfloaterconversationpreview.h index f8796127ba..b0488f4ff1 100755 --- a/indra/newview/llfloaterconversationpreview.h +++ b/indra/newview/llfloaterconversationpreview.h @@ -62,7 +62,7 @@ private: std::string mAccountName; std::string mCompleteName; std::string mChatHistoryFileName; - bool mChatHistoryLoaded; + bool mShowHistory; }; #endif /* LLFLOATERCONVERSATIONPREVIEW_H_ */ |