osg::Group* G1 = new osg::Group;
osg::Group* G2 = new osg::Group;
osg::Group* g = new osg::Group;
osg::Node* n = new osg::Node;
G1->addChild( g );
G2->addChild( g );
g->addChild( n );
int pCnt = g->getNumParents();
for( int i = 0; i < pCnt; i++ )
{
g->getParent(0)->removeChild( g );
}