version 1.16, 2005/02/05 22:59:24
|
version 1.17, 2005/10/24 19:35:25
|
|
|
Sharable() : _ref(1) { } | Sharable() : _ref(1) { } |
| |
virtual ~Sharable(); | virtual ~Sharable(); |
Uint32 getRef() const { return _ref.value(); } |
Uint32 getRef() const { return _ref.get(); } |
| |
friend void Inc(Sharable* sharable); | friend void Inc(Sharable* sharable); |
| |
|
|
// If so, there is a double delete being cause by impropoer use | // If so, there is a double delete being cause by impropoer use |
// of sharable assignment or copy constructors somewhere | // of sharable assignment or copy constructors somewhere |
// << Wed Nov 6 12:46:52 2002 mdd >> | // << Wed Nov 6 12:46:52 2002 mdd >> |
assert(((Sharable*)x)->_ref.value()); |
assert(((Sharable*)x)->_ref.get()); |
x->_ref++; | x->_ref++; |
} | } |
| |
|
|
| |
inline void Dec(Sharable* x) | inline void Dec(Sharable* x) |
{ | { |
if (x && x->_ref.DecAndTestIfZero()) |
if (x && x->_ref.decAndTestIfZero()) |
delete x; | delete x; |
} | } |
| |