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 daeRefCountedObj()11daeRefCountedObj::daeRefCountedObj() : _refCount(0) { } 12 ~daeRefCountedObj()13daeRefCountedObj::~daeRefCountedObj() { } 14 release() const15void daeRefCountedObj::release() const { 16 if (--_refCount <= 0) 17 delete this; 18 } 19 ref() const20void daeRefCountedObj::ref() const { 21 _refCount++; 22 } 23 checkedRelease(const daeRefCountedObj * obj)24void checkedRelease(const daeRefCountedObj* obj) { 25 if (obj) 26 obj->release(); 27 } 28 checkedRef(const daeRefCountedObj * obj)29void checkedRef(const daeRefCountedObj* obj) { 30 if (obj) 31 obj->ref(); 32 } 33