Fixed compilation error in src/osgDB/FileUtils.cpp.

Added support for nested NodeCallbacks, allowing them to be chained together
so that multiple operations can be applied.
This commit is contained in:
Robert Osfield
2001-11-11 22:32:59 +00:00
parent 879a753ee2
commit 5ceefdcc12
9 changed files with 67 additions and 11 deletions

View File

@@ -21,18 +21,26 @@ class ref_ptr
inline ref_ptr& operator = (const ref_ptr& rp)
{
if (_ptr==rp._ptr) return *this;
if (_ptr) _ptr->unref();
T* tmp_ptr = _ptr;
_ptr = rp._ptr;
if (_ptr) _ptr->ref();
// unref second to prevent any deletion of any object which might
// be referenced by the other object. i.e rp is child of the
// original _ptr.
if (tmp_ptr) tmp_ptr->unref();
return *this;
}
inline ref_ptr& operator = (T* ptr)
{
if (_ptr==ptr) return *this;
if (_ptr) _ptr->unref();
T* tmp_ptr = _ptr;
_ptr = ptr;
if (_ptr) _ptr->ref();
// unref second to prevent any deletion of any object which might
// be referenced by the other object. i.e rp is child of the
// original _ptr.
if (tmp_ptr) tmp_ptr->unref();
return *this;
}