class CMan {
public:
CMan() {
if(!_godref) {
_pgod = new CGod();
}
_godref++;
}
~CMan() {
_godref--;
if(!_godref) {
delete _pgod;
}
}
private:
CGod* _pgod;
static int _godref;
};
int CMan::_godref = 0;