...
...
if (mSharedSkeletonEntities != NULL)
{
entity->shareSkeletonInstanceWith(this);
}
.....
....
if entity->mSharedSkeletonEntities != NULL and this->mSharedSkeletonEntities !=NULL will be while(1);

void Entity::shareSkeletonInstanceWith(Entity* entity)
{
+if(mSharedSkeletonEntities != entity->mSharedSkeletonEntities)
+{
..
..
..
+}
}