summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderviewitem.cpp6
-rwxr-xr-xindra/llui/llfolderviewitem.h2
-rw-r--r--indra/llui/llfolderviewmodel.h5
3 files changed, 7 insertions, 6 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 0b04288950..099d51ce17 100755
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -169,7 +169,6 @@ BOOL LLFolderViewItem::postBuild()
// Destroys the object
LLFolderViewItem::~LLFolderViewItem( void )
{
- delete mViewModelItem;
mViewModelItem = NULL;
}
@@ -473,8 +472,9 @@ void LLFolderViewItem::rename(const std::string& new_name)
const std::string& LLFolderViewItem::getName( void ) const
{
- return getViewModelItem()->getName();
- }
+ static const std::string noName("");
+ return getViewModelItem() ? getViewModelItem()->getName() : noName;
+}
// LLView functionality
BOOL LLFolderViewItem::handleRightMouseDown( S32 x, S32 y, MASK mask )
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index d4002c3184..19a6b0a44a 100755
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -87,7 +87,7 @@ protected:
bool mLabelWidthDirty;
S32 mLabelPaddingRight;
LLFolderViewFolder* mParentFolder;
- LLFolderViewModelItem* mViewModelItem;
+ LLPointer<LLFolderViewModelItem> mViewModelItem;
LLFontGL::StyleFlags mLabelStyle;
std::string mLabelSuffix;
LLUIImagePtr mIcon,
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index c6030c9b71..5ec08ae211 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -129,10 +129,11 @@ public:
// This is am abstract base class that users of the folderview classes
// would use to bridge the folder view with the underlying data
-class LLFolderViewModelItem
+class LLFolderViewModelItem : public LLRefCount
{
public:
- virtual ~LLFolderViewModelItem( void ) {};
+ LLFolderViewModelItem() { }
+ virtual ~LLFolderViewModelItem() { }
virtual void update() {} //called when drawing
virtual const std::string& getName() const = 0;