summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-02 18:00:02 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-08-02 18:02:37 +0300
commitc4c5778b263a1f9036ba6c6c18f96d1311988fcb (patch)
tree6b1890fa86da6efbd3693eff23920cb2b9c8151f /indra/llui
parent05b5540fe70067180be6bb664752742b31a49eb7 (diff)
SL-20098 handleDoubleClick crashes in new inventory panels
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderviewitem.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 0093f4c17c..38a1a9a1ab 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -32,6 +32,7 @@
#include "llfolderview.h"
#include "llfolderviewmodel.h"
#include "llpanel.h"
+#include "llcallbacklist.h"
#include "llcriticaldamp.h"
#include "llclipboard.h"
#include "llfocusmgr.h" // gFocusMgr
@@ -1844,7 +1845,12 @@ void LLFolderViewFolder::setOpen(BOOL openitem)
{
if(mSingleFolderMode)
{
- getViewModelItem()->navigateToFolder();
+ // navigateToFolder can destroy this view
+ // delay it in case setOpen was called from click or key processing
+ doOnIdleOneTime([this]()
+ {
+ getViewModelItem()->navigateToFolder();
+ });
}
else
{
@@ -2074,7 +2080,19 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask )
if(mSingleFolderMode)
{
static LLUICachedControl<bool> double_click_new_window("SingleModeDoubleClickOpenWindow", false);
- getViewModelItem()->navigateToFolder(double_click_new_window);
+ if (double_click_new_window)
+ {
+ getViewModelItem()->navigateToFolder(true);
+ }
+ else
+ {
+ // navigating is going to destroy views and change children
+ // delay it untill handleDoubleClick processing is complete
+ doOnIdleOneTime([this]()
+ {
+ getViewModelItem()->navigateToFolder(false);
+ });
+ }
return TRUE;
}