1234567891011121314151617181920212223242526272829 |
- #include "ReferenceCounter.h"
- using namespace Framework;
- ReferenceCounter::ReferenceCounter()
- {
- ref = 1;
- }
- ReferenceCounter::~ReferenceCounter() {}
- int ReferenceCounter::getReferenceCount() const
- {
- return ref;
- }
- ReferenceCounter *ReferenceCounter::getThis()
- {
- ref++;
- return this;
- }
- void *ReferenceCounter::release()
- {
- if( !--ref )
- delete this;
- return 0;
- }
|