From 0aa5e0bb8820b35d68dee093ea2a3d8686231264 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sun, 5 Apr 2020 14:56:35 -0500 Subject: [PATCH 1/2] Close 'default permissions' window on client disconnect. Nonfunctional after that point anyhow. Also applying setting crashes due to null region after dc. --- indra/newview/llappviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6b4b3aff9..704c2cb3c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4832,11 +4832,14 @@ void LLAppViewer::disconnectViewer() // floater_sound_preview.xml // floater_animation_preview.xml // files. + + // A more generic mechanism would be nice.. LLFloater* fl = static_cast(*it); if (fl && (fl->getName() == "Image Preview" || fl->getName() == "Sound Preview" || fl->getName() == "Animation Preview" + || fl->getName() == "perm prefs" )) { floaters_to_close.push_back(fl); From ed7f73769fa98415333a26f3d9416af5476d3d6a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 7 Apr 2020 23:30:12 -0500 Subject: [PATCH 2/2] Potentially fix crash in LLSurface --- indra/newview/llsurface.cpp | 60 +++++-------------------------------- indra/newview/llsurface.h | 2 +- 2 files changed, 9 insertions(+), 53 deletions(-) diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 9f15a389d..81dd36803 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -493,21 +493,10 @@ void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction) { if (surfacep && surfacep == mNeighbors[direction]) { - // Iterate through surface patches, removing any connectivity to removed surface. - // Extra branches for debugging. - if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) + mNeighbors[direction] = NULL; + for (auto& patchp : mPatchList) { - for (auto& patchp : mPatchList) - { - patchp->disconnectNeighbor(surfacep); - } - } - if (gHippoGridManager->getCurrentGrid()->isSecondLife()) - { - for (auto& patchp : mPatchList) - { - patchp->disconnectNeighbor(surfacep); - } + patchp->disconnectNeighbor(surfacep); } } } @@ -515,46 +504,13 @@ void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction) void LLSurface::disconnectAllNeighbors() { - // Pulled out of loop to debug. - if (mNeighbors[EAST]) + for (size_t i = 0; i < mNeighbors.size(); ++i) { - mNeighbors[EAST]->disconnectNeighbor(this, gDirOpposite[EAST]); - } - if (mNeighbors[NORTH]) - { - mNeighbors[NORTH]->disconnectNeighbor(this, gDirOpposite[NORTH]); - } - if (mNeighbors[WEST]) - { - mNeighbors[WEST]->disconnectNeighbor(this, gDirOpposite[WEST]); - } - if (mNeighbors[SOUTH]) - { - mNeighbors[SOUTH]->disconnectNeighbor(this, gDirOpposite[SOUTH]); - } - if (mNeighbors[NORTHEAST]) - { - mNeighbors[NORTHEAST]->disconnectNeighbor(this, gDirOpposite[NORTHEAST]); - } - if (mNeighbors[NORTHWEST]) - { - mNeighbors[NORTHWEST]->disconnectNeighbor(this, gDirOpposite[NORTHWEST]); - } - if (mNeighbors[SOUTHWEST]) - { - mNeighbors[SOUTHWEST]->disconnectNeighbor(this, gDirOpposite[SOUTHWEST]); - } - if (mNeighbors[SOUTHEAST]) - { - mNeighbors[SOUTHEAST]->disconnectNeighbor(this, gDirOpposite[SOUTHEAST]); - } - S32 i; - for (i = 0; i < 8; i++) - { - if (mNeighbors[i]) + auto& neighbor = mNeighbors[i]; + if (neighbor) { - //mNeighbors[i]->disconnectNeighbor(this); - mNeighbors[i] = NULL; + neighbor->disconnectNeighbor(this, gDirOpposite[i]); + neighbor = NULL; } } } diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index 4ffdc3ba4..abc7785ad 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -167,7 +167,7 @@ public: // +---+---+---+ // |SW | S | SE| // +---+---+---+ - LLSurface *mNeighbors[8]; // Adjacent patches + std::array mNeighbors; // Adjacent patches U32 mType; // Useful for identifying derived classes