void Skeleton::destroy() { for (BoneNodeMap::iterator it = _boneNodes.begin(); it != _boneNodes.end(); ++it) { BoneNode* r = it->second; if (r) { Bone* b = r->getBone(); delete b; r->detachObject(); delete r; } } _clear(); }
void Skeleton::destroy() { //STLDeleteAssociate(_boneNodes); // BoneNodeMap::iterator it = _boneNodes.begin(); // for (; it != _boneNodes.end(); ++it) // { // BoneNode* n = it->second; // if (n) // { // delete n; // n = NULL; // } // } BoneNode* r = getRootBoneNode(); if (r) { r->detachObject(); r->release(); //r = NULL; } _boneNodes.clear(); }