From 5de94d661095b848c034ebb60e53aa951669a059 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 23 Apr 2020 14:56:47 -0500 Subject: [PATCH] Address several remaining 1.8.9.8373 crashes reported on --- indra/llrender/llvertexbuffer.cpp | 13 +++++++++++++ indra/newview/llchatbar.cpp | 23 ++++++++++++++++------- indra/newview/llcloud.cpp | 4 ++++ indra/newview/llhudicon.cpp | 2 +- indra/newview/llimprocessing.cpp | 5 +++++ indra/newview/llviewerkeyboard.cpp | 13 +++++++++---- indra/newview/llviewerwindow.cpp | 4 ++-- 7 files changed, 50 insertions(+), 14 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 201a65ce6..f766af31b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1197,6 +1197,10 @@ void LLVertexBuffer::genBuffer(U32 size) { mMappedData = sDynamicVBOPool.allocate(mGLBuffer, mSize); } + if ((sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) && !mMappedData) + { + LL_ERRS() << "mMappedData allocation failedd" << LL_ENDL; + } sGLCount++; } @@ -1213,6 +1217,10 @@ void LLVertexBuffer::genIndices(U32 size) { mMappedIndexData = sDynamicIBOPool.allocate(mGLIndices, mIndicesSize); } + if ((sDisableVBOMapping || mUsage != GL_DYNAMIC_DRAW_ARB) && !mMappedIndexData) + { + LL_ERRS() << "mMappedIndexData allocation failedd" << LL_ENDL; + } sGLCount++; } @@ -1848,6 +1856,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range LL_ERRS() << "Attempted to map a specific range of a buffer that was already mapped." << LL_ENDL; } + bool was_locked = mIndexLocked; if (!mIndexLocked) { mIndexLocked = true; @@ -1942,6 +1951,10 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range LL_ERRS() << "glMapBuffer returned NULL (no index data)" << LL_ENDL; } + else if (was_locked) + { + LL_ERRS() << "mIndexLocked was true but no Index data allocated" << LL_ENDL; + } else { LL_ERRS() << "memory allocation for Index data failed. " << LL_ENDL; diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 3d8dde517..794957107 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -531,17 +531,24 @@ void LLChatBar::sendChat( EChatType type ) // static void LLChatBar::startChat(const char* line) { + if (!gChatBar || !gChatBar->getParent()) + { + return; + } gChatBar->getParent()->setVisible(TRUE); gChatBar->setKeyboardFocus(TRUE); gSavedSettings.setBOOL("ChatVisible", TRUE); - if (line && gChatBar->mInputEditor) + if (gChatBar->mInputEditor) { - std::string line_string(line); - gChatBar->mInputEditor->setText(line_string); + if (line) + { + std::string line_string(line); + gChatBar->mInputEditor->setText(line_string); + } + // always move cursor to end so users don't obliterate chat when accidentally hitting WASD + gChatBar->mInputEditor->setCursorToEnd(); } - // always move cursor to end so users don't obliterate chat when accidentally hitting WASD - gChatBar->mInputEditor->setCursorToEnd(); } @@ -550,7 +557,8 @@ void LLChatBar::startChat(const char* line) void LLChatBar::stopChat() { // In simple UI mode, we never release focus from the chat bar - gChatBar->setKeyboardFocus(FALSE); + if (gChatBar) + gChatBar->setKeyboardFocus(FALSE); // If we typed a movement key and pressed return during the // same frame, the keyboard handlers will see the key as having @@ -562,7 +570,8 @@ void LLChatBar::stopChat() gAgent.stopTyping(); // hide chat bar so it doesn't grab focus back - gChatBar->getParent()->setVisible(FALSE); + if (gChatBar && gChatBar->getParent()) + gChatBar->getParent()->setVisible(FALSE); gSavedSettings.setBOOL("ChatVisible", FALSE); } diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp index 062d190be..0d38ecbb6 100644 --- a/indra/newview/llcloud.cpp +++ b/indra/newview/llcloud.cpp @@ -515,6 +515,10 @@ void LLCloudLayer::connectNeighbor(LLCloudLayer *cloudp, U32 direction) return; } + if (mNeighbors[direction]) + { + mNeighbors[direction]->mNeighbors[gDirOpposite[direction]] = NULL; + } mNeighbors[direction] = cloudp; if (cloudp) mNeighbors[direction]->mNeighbors[gDirOpposite[direction]] = this; diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 16a0b6167..574084991 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -94,7 +94,7 @@ void LLHUDIcon::renderIcon(BOOL for_select) if (mHidden) return; - if (mSourceObject.isNull() || mImagep.isNull()) + if (mSourceObject.isNull() || mImagep.isNull() || mSourceObject->mDrawable.isNull()) { markDead(); return; diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 36e1ef95d..34d6a491e 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1895,6 +1895,11 @@ void LLIMProcessing::requestOfflineMessages() void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder) { + if (LLApp::isQuitting() || !gAgent.getRegion()) + { + return; + } + auto status = responder.getStatus(); if (!responder.isGoodStatus(status)) // success = httpResults["success"].asBoolean(); diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index bb1c236c5..271d555ba 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -548,24 +548,29 @@ void start_chat( EKeystate s ) } // start chat - gChatBar->startChat(NULL); + LLChatBar::startChat(NULL); } void start_gesture( EKeystate s ) { + if (LLAppViewer::instance()->quitRequested()) + { + return; // can't talk, gotta go, kthxbye! + } + LLUICtrl* focus_ctrlp = dynamic_cast(gFocusMgr.getKeyboardFocus()); if (KEYSTATE_UP == s && ! (focus_ctrlp && focus_ctrlp->acceptsTextInput())) { - if (gChatBar->getCurrentChat().empty()) + if (gChatBar && gChatBar->getCurrentChat().empty()) { // No existing chat in chat editor, insert '/' - gChatBar->startChat("/"); + LLChatBar::startChat("/"); } else { // Don't overwrite existing text in chat editor - gChatBar->startChat(NULL); + LLChatBar::startChat(NULL); } } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ded7fb2fa..b3ca313cf 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2946,7 +2946,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { { // passing NULL here, character will be added later when it is handled by character handler. - gChatBar->startChat(NULL); + LLChatBar::startChat(NULL); return TRUE; } } @@ -3548,7 +3548,7 @@ void LLViewerWindow::updateLayout() && gFocusMgr.getKeyboardFocus() == NULL && gChatBar->isInVisibleChain()) { - gChatBar->startChat(NULL); + LLChatBar::startChat(NULL); } }