diff options
author | Boroondas Gupte <hg@boroon.dasgupta.ch> | 2010-10-08 01:43:23 +0200 |
---|---|---|
committer | Boroondas Gupte <hg@boroon.dasgupta.ch> | 2010-10-08 01:43:23 +0200 |
commit | 8f35e76f7396359903b3dd2a806ff769fa377a36 (patch) | |
tree | 37b37c7899aeb243aa6fd1a2b2890586394475d2 /indra/llui | |
parent | d25a30e55b7e6a20173c3a53891489adc5610d72 (diff) | |
parent | ea2005edf062b69e88261e2a824bdbb6e2b2db7d (diff) |
merged VWR-23239 (fixed memory leak in LLUIString)
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lluistring.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index eff2467bf0..4faa0e070e 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -58,10 +58,12 @@ class LLUIString public: // These methods all perform appropriate argument substitution // and modify mOrig where appropriate - LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} + LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); } + ~LLUIString() { delete mArgs; } + void assign(const std::string& instring); LLUIString& operator=(const std::string& s) { assign(s); return *this; } @@ -81,14 +83,14 @@ public: void clear(); void clearArgs() { if (mArgs) mArgs->clear(); } - + // These utility functions are included for text editing. // They do not affect mOrig and do not perform argument substitution void truncate(S32 maxchars); void erase(S32 charidx, S32 len); void insert(S32 charidx, const LLWString& wchars); void replace(S32 charidx, llwchar wc); - + private: // something changed, requiring reformatting of strings void dirty(); @@ -100,7 +102,7 @@ private: void updateResult() const; void updateWResult() const; LLStringUtil::format_map_t& getArgs(); - + std::string mOrig; mutable std::string mResult; mutable LLWString mWResult; // for displaying |