summaryrefslogtreecommitdiff
path: root/indra/llcommon/llpointer.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llpointer.h')
-rwxr-xr-xindra/llcommon/llpointer.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h
index 6a0a8fcb0d..c827996db1 100755
--- a/indra/llcommon/llpointer.h
+++ b/indra/llcommon/llpointer.h
@@ -173,15 +173,23 @@ public:
typedef LLPointer<Type> pointer_t;
LLCopyOnWritePointer()
+ : mStayUnique(false)
{}
LLCopyOnWritePointer(Type* ptr)
- : LLPointer<Type>(ptr)
+ : LLPointer<Type>(ptr),
+ mStayUnique(false)
{}
LLCopyOnWritePointer(LLPointer<Type>& ptr)
- : LLPointer<Type>(ptr)
- {}
+ : LLPointer<Type>(ptr),
+ mStayUnique(false)
+ {
+ if (ptr.mForceUnique)
+ {
+ makeUnique();
+ }
+ }
Type* write()
{
@@ -199,6 +207,10 @@ public:
const Type* operator->() const { return pointer_t::mPointer; }
const Type& operator*() const { return *pointer_t::mPointer; }
+
+ void setStayUnique(bool stay) { makeUnique(); mStayUnique = stay; }
+private:
+ bool mStayUnique;
};
#endif