Made the more of the OSG's referenced object desctructors protected to ensure
that they arn't created on the stack inappropriately. Split the implemention of Matrix up so that it is a simple no referenced counted class and can be safefly created on the stack. To support referenced counting a seperate subclass now exists, this is RefMatrix which inherits from both Matrix and Object.
This commit is contained in:
@@ -16,7 +16,7 @@ class ref_ptr
|
||||
ref_ptr() :_ptr(0L) {}
|
||||
ref_ptr(T* t):_ptr(t) { if (_ptr) _ptr->ref(); }
|
||||
ref_ptr(const ref_ptr& rp):_ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||
~ref_ptr() { if (_ptr) _ptr->unref(); }
|
||||
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr=0; }
|
||||
|
||||
inline ref_ptr& operator = (const ref_ptr& rp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user