diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-09-14 12:35:52 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <118752495+marchcat@users.noreply.github.com> | 2026-09-14 14:00:20 +0300 |
| commit | 28f4e9b352a34d4fe551e13d37d3967b41bd5893 (patch) | |
| tree | 04343a55e474e804f90ac32b68454a5045e2a110 /indra/llui/llfolderviewitem.cpp | |
| parent | 01f554d1a0a461f1ad3d7321566a04e7987038df (diff) | |
#6310 Harden inventory view lifetime handling
Diffstat (limited to 'indra/llui/llfolderviewitem.cpp')
| -rw-r--r-- | indra/llui/llfolderviewitem.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index c8ef421677..7c51574fc2 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -234,7 +234,11 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) // Destroys the object LLFolderViewItem::~LLFolderViewItem() { - mViewModelItem = NULL; + if (mViewModelItem) + { + mViewModelItem->setFolderViewItem(nullptr); + mViewModelItem = nullptr; + } gFocusMgr.removeKeyboardFocusWithoutCallback(this); } @@ -356,7 +360,12 @@ bool LLFolderViewItem::isPotentiallyVisible(S32 filter_generation) void LLFolderViewItem::refresh() { - LLFolderViewModelItem& vmi = *getViewModelItem(); + LLFolderViewModelItem* vmi_ptr = getViewModelItem(); + if (!vmi_ptr) + { + return; + } + LLFolderViewModelItem& vmi = *vmi_ptr; mLabel = utf8str_to_wstring(vmi.getDisplayName()); mLabelFontBuffer.reset(); @@ -387,6 +396,10 @@ void LLFolderViewItem::refresh() void LLFolderViewItem::refreshSuffix() { LLFolderViewModelItem const* vmi = getViewModelItem(); + if (!vmi) + { + return; + } // icons are slightly expensive to get, can be optimized // see LLInventoryIcon::getIcon() |
