Re: [C++-sig] transfer ownership problem

2011-05-04 Thread Jim Bosch
On 05/04/2011 08:01 AM, zeb wrote: hi, I have some problem about transfer-ownership. C++ code is like this: class RefCounter { int _count; public: RefCounter() : _count(1) {} virtual RefCounter() {} void addRef() { ++_count; } void release() { --_count; if (_count == 0) d

[C++-sig] transfer ownership problem

2011-05-04 Thread zeb
hi, I have some problem about transfer-ownership. C++ code is like this: class RefCounter { int _count; public: RefCounter() : _count(1) {} virtual RefCounter() {} void addRef() { ++_count; } void release() { --_count; if (_count == 0) delete this; } }; class A : public RefCoun