add: fprintf(stderr, "%p %p %p\n", p1.getBaseCPtr(), p1.getAspectCPtr(0), p1.getAspectCPtr(1));
context: int main (int argc, char **argv){    OSG::osgInit(argc, argv);    OSG::Thread::getCurrent()->getChangeList()->dump();    OSG::Thread::getCurrent()->getChangeList()->clearAll();    OSG::Thread::getCurrent()->getChangeList()->dump();    OSG::PLOG << "Num types : "              << OSG::FieldContainerFactory::the()->getNumTypes()              << std::endl;    OSG::FieldContainerPtr pFC;    pFC.dump(0, OSG::FCDumpFlags::RefCount);    pFC = OSG::FieldContainerFactory::the()->createNode("Node");    pFC.dump(0, OSG::FCDumpFlags::RefCount);    OSG::addRefCP(pFC);    pFC.dump(0, OSG::FCDumpFlags::RefCount);    OSG::Thread::getCurrent()->getChangeList()->dump();    pFC->dump();    OSG::subRefCP(pFC);    pFC.dump(0, OSG::FCDumpFlags::RefCount);    OSG::Thread::getCurrent()->getChangeList()->dump();    OSG::Thread::getCurrent()->getChangeList()->clearAll();    OSG::NodePtr           p1  = OSG::Node::create();    OSG::FieldContainerPtr pb1 = p1;    OSG::addRefCP(p1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    pb1.dump(0, OSG::FCDumpFlags::RefCount);    std::cerr << " N : " << p1->getType().getId()              << std::endl;    std::cerr << " N : " << OSG::Node::getClassType().getId() << std::endl;    OSG::NodePtr p2 = OSG::Node::create();    OSG::NodePtr p3 = OSG::Node::create();    OSG::NodePtr p4 = OSG::Node::create();    OSG::NodePtr p5 = OSG::Node::create();    OSG::NodePtr p6 = OSG::Node::create();    p1->dump (0, OSG::FCDumpFlags::RefCount);    p2->dump (0, OSG::FCDumpFlags::RefCount);    p3->dump (0, OSG::FCDumpFlags::RefCount);    p4->dump (0, OSG::FCDumpFlags::RefCount);    p5->dump (0, OSG::FCDumpFlags::RefCount);    p6->dump (0, OSG::FCDumpFlags::RefCount);    OSG::addRefCP(p6);    OSG::beginEditCP(p1);    std::cerr << "add p2" << std::endl;    p1->addChild(p2);    p1->dump (0, OSG::FCDumpFlags::RefCount);    p1.dump(0, OSG::FCDumpFlags::RefCount);    std::cerr << "add p3" << std::endl;    OSG::addRefCP(p3);    p1->addChild(p3);    p1->dump (0, OSG::FCDumpFlags::RefCount);    p1.dump  (0, OSG::FCDumpFlags::RefCount);    p3.dump  (0, OSG::FCDumpFlags::RefCount);    std::cerr << "insert p4" << std::endl;    p1->insertChild(1, p4);    p1->dump (0, OSG::FCDumpFlags::RefCount);    p1.dump  (0, OSG::FCDumpFlags::RefCount);    std::cerr << "replace p3 -> p5" << std::endl;    p1->replaceChild(2, p5);    p1->dump (0, OSG::FCDumpFlags::RefCount);    p1.dump  (0, OSG::FCDumpFlags::RefCount);    OSG::Thread::getCurrent()->getChangeList()->dump();    p3.dump (0, OSG::FCDumpFlags::RefCount);    p3->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << "replace p5 -> p3" << std::endl;    p1->replaceChildBy(p5, p3);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << "sub p2" << std::endl;    p2.dump (0, OSG::FCDumpFlags::RefCount);    p1->subChild(p2);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << "sub p6" << std::endl;    p1->subChild(p6);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << "sub child 1" << std::endl;    p1->subChild(1);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << "sub child 0" << std::endl;    p1->subChild(0);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    OSG::endEditCP(p1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p2.dump (0, OSG::FCDumpFlags::RefCount);    p3.dump (0, OSG::FCDumpFlags::RefCount);    p4.dump (0, OSG::FCDumpFlags::RefCount);    p5.dump (0, OSG::FCDumpFlags::RefCount);    p6.dump (0, OSG::FCDumpFlags::RefCount);    std::cerr << std::endl << std::endl << "Core test" << std::endl;    p1.dump (0, OSG::FCDumpFlags::RefCount);    OSG::GroupPtr g1 = OSG::Group::create();    p1->setCore(g1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    g1.dump (0, OSG::FCDumpFlags::RefCount);    p1->setCore(OSG::NullFC);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    g1.dump (0, OSG::FCDumpFlags::RefCount);    g1 = OSG::Group::create();    p1->setCore(g1);    g1.dump (0, OSG::FCDumpFlags::RefCount);    p2 = OSG::NodePtr::dcast(p1->shallowCopy());//    OSG::addRefCP(p2);    g1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p2->dump(0, OSG::FCDumpFlags::RefCount);    p1->setCore(g1);    g1.dump (0, OSG::FCDumpFlags::RefCount);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p2->dump(0, OSG::FCDumpFlags::RefCount);    std::cerr << std::endl << std::endl << "Indirect Del" << std::endl;    p2->setCore(OSG::NullFC);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p2.dump(0, OSG::FCDumpFlags::RefCount);    std::cerr << std::endl << std::endl << "Attachment test" << std::endl;    OSG::NamePtr n1 = OSG::Name::create();    OSG::NamePtr n2 = OSG::Name::create();    p1->addAttachment(n1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    n1.dump (0, OSG::FCDumpFlags::RefCount);    p1->subAttachment(n1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    n1.dump (0, OSG::FCDumpFlags::RefCount);    n1 = OSG::Name::create();    p1->addAttachment(n1);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    n1.dump (0, OSG::FCDumpFlags::RefCount);    p1->addAttachment(n2);    p1.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    n1.dump (0, OSG::FCDumpFlags::RefCount);    n2.dump (0, OSG::FCDumpFlags::RefCount);    p2 = OSG::NodePtr::dcast(p1->shallowCopy());    p1.dump (0, OSG::FCDumpFlags::RefCount);    p2.dump (0, OSG::FCDumpFlags::RefCount);    p1->dump(0, OSG::FCDumpFlags::RefCount);    p2->dump(0, OSG::FCDumpFlags::RefCount);    // test name convenience functions        std::cerr << "Name convenience" << std::endl;        if(OSG::getName(p3) == NULL)    {        std::cerr << "No name: (NULL)" << std::endl;    }    else    {        std::cerr << "Strange No name not NULL: "                   << OSG::getName(p3)                    << std::endl;    }    OSG::setName(p3, "Hugo");        std::cerr << "Name: " << OSG::getName(p3) << std::endl;        OSG::setName(p3, std::string("Hugo"));        std::cerr << "String Name: " << OSG::getName(p3) << std::endl;         OSG::setName(p3, NULL);        if(OSG::getName(p3) == NULL)    {        std::cerr << "Removed name: (NULL)" << std::endl;    }    else    {        std::cerr << "Removed name not NULL: "                   << OSG::getName(p3)                    << std::endl;    }    if(OSG::getVoidP(p3) == NULL)    {        std::cerr << "No VoidPAttachent: (NULL)" << std::endl;    }    else    {        std::cerr << "Strange No VoidPAttachent not NULL: "                   << OSG::getVoidP(p3)                   << std::endl;    }    double d;    OSG::setVoidP(p3, &d);    std::cerr << "VoidPAttachent: "               << (&d)               << " | "              << OSG::getVoidP(p3) << std::endl;    OSG::setVoidP(p3, NULL);    if(OSG::getVoidP(p3) == NULL)    {        std::cerr << "Removed VoidPAttachent: (NULL)" << std::endl;    }    else    {        std::cerr << "Strange Removed VoidPAttachent not NULL: "                   << OSG::getVoidP(p3)                   << std::endl;    }    OSG::subRefCP(p3);    OSG::subRefCP(p1);    OSG::osgExit();}