1 /* 2 * Copyright 2006 Sony Computer Entertainment Inc. 3 * 4 * Licensed under the MIT Open Source License, for details please see license.txt or the website 5 * http://www.opensource.org/licenses/mit-license.php 6 * 7 */ 8 9 #include <dae/daeRefCountedObj.h> 10 11 daeRefCountedObj::daeRefCountedObj() : _refCount(0) { } 12 13 daeRefCountedObj::~daeRefCountedObj() { } 14 15 void daeRefCountedObj::release() const { 16 if (--_refCount <= 0) 17 delete this; 18 } 19 20 void daeRefCountedObj::ref() const { 21 _refCount++; 22 } 23 24 void checkedRelease(const daeRefCountedObj* obj) { 25 if (obj) 26 obj->release(); 27 } 28 29 void checkedRef(const daeRefCountedObj* obj) { 30 if (obj) 31 obj->ref(); 32 } 33