123456789101112131415161718192021222324252627 |
- #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;
- }
|