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