summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-10-25 18:16:56 -0700
committerMerov Linden <merov@lindenlab.com>2012-10-25 18:16:56 -0700
commitd49de3a66a5476f4541f15dc61c68e0e509c4c70 (patch)
tree7b1245ccbc660130e7973999af04acbb1d19349c /indra/llui
parentb5d76c2b55666083279580f383e5a7b139517504 (diff)
CHUI-441 : WIP : Fix crashes when spawning torn off floaters, added widgets creation in the torn off floater for participants.
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;