diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-08-02 18:00:02 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-08-02 18:02:37 +0300 |
commit | c4c5778b263a1f9036ba6c6c18f96d1311988fcb (patch) | |
tree | 6b1890fa86da6efbd3693eff23920cb2b9c8151f /indra/newview | |
parent | 05b5540fe70067180be6bb664752742b31a49eb7 (diff) |
SL-20098 handleDoubleClick crashes in new inventory panels
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 0801b71e34..eb603f0ac3 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2449,7 +2449,19 @@ BOOL LLInventoryGalleryItem::handleDoubleClick(S32 x, S32 y, MASK mask) { if (mIsFolder && mGallery) { - mGallery->setRootFolder(mUUID); + // setRootFolder can destroy this item. + // Delay it until handleDoubleClick processing is complete + // or make gallery handle doubleclicks. + LLHandle<LLPanel> handle = mGallery->getHandle(); + LLUUID navigate_to = mUUID; + doOnIdleOneTime([handle, navigate_to]() + { + LLInventoryGallery* gallery = (LLInventoryGallery*)handle.get(); + if (gallery) + { + gallery->setRootFolder(navigate_to); + } + }); } else { |