summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderviewitem.cpp8
-rwxr-xr-xindra/llui/llfolderviewmodel.h9
-rwxr-xr-xindra/llui/lltextbase.cpp16
-rwxr-xr-xindra/llui/lltextbase.h8
-rwxr-xr-xindra/llui/lluictrl.cpp40
-rwxr-xr-xindra/llui/llview.cpp3
-rwxr-xr-xindra/llui/llview.h2
-rwxr-xr-xindra/llui/llviewmodel.cpp10
8 files changed, 56 insertions, 40 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 802cb783ed..ac36cd1173 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1496,16 +1496,12 @@ void LLFolderViewFolder::extractItem( LLFolderViewItem* item )
ft = std::find(mFolders.begin(), mFolders.end(), f);
if (ft != mFolders.end())
{
- disclaimMem(mFolders);
mFolders.erase(ft);
- claimMem(mFolders);
}
}
else
{
- disclaimMem(mItems);
mItems.erase(it);
- claimMem(mItems);
}
//item has been removed, need to update filter
getViewModelItem()->removeChild(item->getViewModelItem());
@@ -1582,9 +1578,7 @@ void LLFolderViewFolder::addItem(LLFolderViewItem* item)
}
item->setParentFolder(this);
- disclaimMem(mItems);
mItems.push_back(item);
- claimMem(mItems);
item->setRect(LLRect(0, 0, getRect().getWidth(), 0));
item->setVisible(FALSE);
@@ -1607,9 +1601,7 @@ void LLFolderViewFolder::addFolder(LLFolderViewFolder* folder)
folder->mParentFolder->extractItem(folder);
}
folder->mParentFolder = this;
- disclaimMem(mFolders);
mFolders.push_back(folder);
- claimMem(mFolders);
folder->setOrigin(0, 0);
folder->reshape(getRect().getWidth(), 0);
folder->setVisible(FALSE);
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 3f62d133e4..c665dce509 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -111,6 +111,10 @@ public:
class LLFolderViewModelInterface : public LLTrace::MemTrackable<LLFolderViewModelInterface>
{
public:
+ LLFolderViewModelInterface()
+ : LLTrace::MemTrackable<LLFolderViewModelInterface>("LLFolderViewModelInterface")
+ {}
+
virtual ~LLFolderViewModelInterface() {}
virtual void requestSortAll() = 0;
@@ -131,7 +135,10 @@ public:
class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable<LLFolderViewModelItem>
{
public:
- LLFolderViewModelItem() { }
+ LLFolderViewModelItem()
+ : LLTrace::MemTrackable<LLFolderViewModelItem>("LLFolderViewModelItem")
+ {}
+
virtual ~LLFolderViewModelItem() { }
virtual void update() {} //called when drawing
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 5c221edea7..730c3b2ada 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -576,7 +576,7 @@ void LLTextBase::drawText()
if ( (mSpellCheckStart != start) || (mSpellCheckEnd != end) )
{
const LLWString& wstrText = getWText();
- disclaimMem(mMisspellRanges).clear();
+ mMisspellRanges.clear();
segment_set_t::const_iterator seg_it = getSegIterContaining(start);
while (mSegments.end() != seg_it)
@@ -652,7 +652,6 @@ void LLTextBase::drawText()
mSpellCheckStart = start;
mSpellCheckEnd = end;
- claimMem(mMisspellRanges);
}
}
else
@@ -922,11 +921,9 @@ void LLTextBase::createDefaultSegment()
if (mSegments.empty())
{
LLStyleConstSP sp(new LLStyle(getStyleParams()));
- disclaimMem(mSegments);
LLTextSegmentPtr default_segment = new LLNormalTextSegment( sp, 0, getLength() + 1, *this);
mSegments.insert(default_segment);
default_segment->linkToDocument(this);
- claimMem(mSegments);
}
}
@@ -937,8 +934,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert)
return;
}
- disclaimMem(mSegments);
-
segment_set_t::iterator cur_seg_iter = getSegIterContaining(segment_to_insert->getStart());
S32 reflow_start_index = 0;
@@ -1011,7 +1006,6 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert)
// layout potentially changed
needsReflow(reflow_start_index);
- claimMem(mSegments);
}
BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -1322,10 +1316,8 @@ void LLTextBase::replaceWithSuggestion(U32 index)
removeStringNoUndo(it->first, it->second - it->first);
// Insert the suggestion in its place
- disclaimMem(mSuggestionList);
LLWString suggestion = utf8str_to_wstring(mSuggestionList[index]);
insertStringNoUndo(it->first, utf8str_to_wstring(mSuggestionList[index]));
- claimMem(mSuggestionList);
setCursorPos(it->first + (S32)suggestion.length());
@@ -1388,7 +1380,7 @@ bool LLTextBase::isMisspelledWord(U32 pos) const
void LLTextBase::onSpellCheckSettingsChange()
{
// Recheck the spelling on every change
- disclaimMem(mMisspellRanges).clear();
+ mMisspellRanges.clear();
mSpellCheckStart = mSpellCheckEnd = -1;
}
@@ -1666,7 +1658,7 @@ LLRect LLTextBase::getTextBoundingRect()
void LLTextBase::clearSegments()
{
- disclaimMem(mSegments).clear();
+ mSegments.clear();
createDefaultSegment();
}
@@ -3210,9 +3202,7 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip)
LL_WARNS() << "LLTextSegment::setToolTip: cannot replace keyword tooltip." << LL_ENDL;
return;
}
- disclaimMem(mTooltip);
mTooltip = tooltip;
- claimMem(mTooltip);
}
bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index b1558a7abe..87f1a10cc5 100755
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -53,11 +53,13 @@ class LLUrlMatch;
///
class LLTextSegment
: public LLRefCount,
- public LLMouseHandler,
- public LLTrace::MemTrackable<LLTextSegment>
+ public LLMouseHandler
{
public:
- LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){};
+ LLTextSegment(S32 start, S32 end)
+ : mStart(start),
+ mEnd(end)
+ {}
virtual ~LLTextSegment();
virtual bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const;
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 9a81c91e0d..546cd6fc46 100755
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -941,7 +941,9 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (L
}
boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb )
{
- if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t());
+ if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ claimMem(mValidateSignal);
+
return mValidateSignal->connect(boost::bind(cb, _2));
}
@@ -1004,55 +1006,73 @@ boost::signals2::connection LLUICtrl::setValidateCallback(const EnableCallbackPa
boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb )
{
- if (!mCommitSignal) mCommitSignal = claimMem(new commit_signal_t());
+ if (!mCommitSignal) mCommitSignal = new commit_signal_t();
+ claimMem(mCommitSignal);
+
return mCommitSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb )
{
- if (!mValidateSignal) mValidateSignal = claimMem(new enable_signal_t());
+ if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ claimMem(mValidateSignal);
+
return mValidateSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb )
{
- if (!mMouseEnterSignal) mMouseEnterSignal = claimMem(new commit_signal_t());
+ if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t();
+ claimMem(mMouseEnterSignal);
+
return mMouseEnterSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb )
{
- if (!mMouseLeaveSignal) mMouseLeaveSignal = claimMem(new commit_signal_t());
+ if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t();
+ claimMem(mMouseLeaveSignal);
+
return mMouseLeaveSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb )
{
- if (!mMouseDownSignal) mMouseDownSignal = claimMem(new mouse_signal_t());
+ if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t();
+ claimMem(mMouseDownSignal);
+
return mMouseDownSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb )
{
- if (!mMouseUpSignal) mMouseUpSignal = claimMem(new mouse_signal_t());
+ if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t();
+ claimMem(mMouseUpSignal);
+
return mMouseUpSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb )
{
- if (!mRightMouseDownSignal) mRightMouseDownSignal = claimMem(new mouse_signal_t());
+ if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t();
+ claimMem(mRightMouseDownSignal);
+
return mRightMouseDownSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb )
{
- if (!mRightMouseUpSignal) mRightMouseUpSignal = claimMem(new mouse_signal_t());
+ if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t();
+ claimMem(mRightMouseUpSignal);
+
return mRightMouseUpSignal->connect(cb);
}
boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb )
{
- if (!mDoubleClickSignal) mDoubleClickSignal = claimMem(new mouse_signal_t());
+ if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t();
+ claimMem(mDoubleClickSignal);
+
return mDoubleClickSignal->connect(cb);
}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e81d19ae3a..e3b3444a00 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -131,7 +131,8 @@ LLView::Params::Params()
}
LLView::LLView(const LLView::Params& p)
-: mVisible(p.visible),
+: LLTrace::MemTrackable<LLView>("LLView"),
+ mVisible(p.visible),
mInDraw(false),
mName(p.name),
mParentView(NULL),
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 3a0dfb5f42..665aad70cf 100755
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -167,7 +167,7 @@ protected:
private:
// widgets in general are not copyable
- LLView(const LLView& other) {};
+ LLView(const LLView& other);
public:
//#if LL_DEBUG
static BOOL sIsDrawing;
diff --git a/indra/llui/llviewmodel.cpp b/indra/llui/llviewmodel.cpp
index 6459ade027..282addf692 100755
--- a/indra/llui/llviewmodel.cpp
+++ b/indra/llui/llviewmodel.cpp
@@ -37,13 +37,15 @@
///
LLViewModel::LLViewModel()
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
}
/// Instantiate an LLViewModel with an existing data value
LLViewModel::LLViewModel(const LLSD& value)
- : mDirty(false)
+: LLTrace::MemTrackable<LLViewModel>("LLViewModel"),
+ mDirty(false)
{
setValue(value);
}
@@ -79,12 +81,14 @@ LLTextViewModel::LLTextViewModel(const LLSD& value)
/// Update the stored value
void LLTextViewModel::setValue(const LLSD& value)
{
- LLViewModel::setValue(value);
// approximate LLSD storage usage
disclaimMem(mDisplay.size());
+ LLViewModel::setValue(value);
disclaimMem(mDisplay);
mDisplay = utf8str_to_wstring(value.asString());
+
claimMem(mDisplay);
+ // approximate LLSD storage usage
claimMem(mDisplay.size());
// mDisplay and mValue agree