Changeset 1176

Show
Ignore:
Timestamp:
04/18/08 04:01:03 (3 weeks ago)
Author:
vossg
Message:

fixed: attachmentmap ref counting, cluster sync

: test program leftover containers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/Contrib/VTK/testVTK.cpp

    r1167 r1176  
    775775} 
    776776 
    777 int main (int argc, char **argv) 
     777int doMain (int argc, char **argv) 
    778778{ 
    779779    osgInit(argc,argv); 
     
    968968    tball.setTranslationScale(scale); 
    969969    tball.setRotationCenter(tCenter); 
     970     
     971    return 0; 
     972} 
     973 
     974int main (int argc, char **argv) 
     975{ 
     976    doMain(argc, argv); 
    970977 
    971978    // run... 
    972      
    973979    glutMainLoop(); 
    974      
     980 
    975981    return 0; 
    976982} 
    977  
  • trunk/Source/Contrib/VTK/testVTKCluster.cpp

    r1167 r1176  
    14141414} 
    14151415 
    1416 int main(int argc,char **argv) 
     1416int doMain(int argc,char **argv) 
    14171417{ 
    14181418    int                      i,winid; 
     
    16161616    } 
    16171617 
    1618     try 
    1619     { 
    1620         osgInit(argc, argv); 
    1621         glutInit(&argc, argv); 
    1622         glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); 
    1623         glutInitWindowSize(winwidth,winheight); 
    1624         winid = glutCreateWindow("OpenSG Cluster Client"); 
    1625         glutKeyboardFunc(key); 
    1626         glutReshapeFunc(reshape); 
    1627         glutDisplayFunc(display);        
    1628         glutMouseFunc(mouse);    
    1629         glutMotionFunc(motion);  
    1630         ract = RenderAction::create(); 
    1631  
    1632         // clear changelist from prototypes 
    1633         OSG::Thread::getCurrentChangeList()->clear(); 
    1634  
    1635         // create cluster window 
    1636         switch(type) 
    1637         { 
    1638             case 'M':  
    1639                 multidisplay=MultiDisplayWindow::create(); 
    1640                 clusterWindow=multidisplay; 
    1641                 break; 
     1618    osgInit(argc, argv); 
     1619    glutInit(&argc, argv); 
     1620    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); 
     1621    glutInitWindowSize(winwidth,winheight); 
     1622    winid = glutCreateWindow("OpenSG Cluster Client"); 
     1623    glutKeyboardFunc(key); 
     1624    glutReshapeFunc(reshape); 
     1625    glutDisplayFunc(display);        
     1626    glutMouseFunc(mouse);    
     1627    glutMotionFunc(motion);  
     1628    ract = RenderAction::create(); 
     1629     
     1630    // clear changelist from prototypes 
     1631    OSG::Thread::getCurrentChangeList()->clear(); 
     1632 
     1633    // create cluster window 
     1634    switch(type) 
     1635    { 
     1636        case 'M':  
     1637            multidisplay=MultiDisplayWindow::create(); 
     1638            clusterWindow=multidisplay; 
     1639            break; 
    16421640#ifdef HAVE_SORT 
    1643             case 'F': 
    1644                 sortfirst=SortFirstWindow::create(); 
    1645  
    1646                 if(compose) 
    1647                     sortfirst->setCompose(true); 
    1648                 else 
    1649                     sortfirst->setCompose(false); 
    1650  
    1651                 clusterWindow=sortfirst; 
    1652                 break; 
    1653             case 'L': 
    1654                 sortlast=SortLastWindow::create(); 
    1655  
    1656                 if(!composerType.empty()) 
     1641        case 'F': 
     1642            sortfirst=SortFirstWindow::create(); 
     1643             
     1644            if(compose) 
     1645                sortfirst->setCompose(true); 
     1646            else 
     1647                sortfirst->setCompose(false); 
     1648             
     1649            clusterWindow=sortfirst; 
     1650            break; 
     1651        case 'L': 
     1652            sortlast=SortLastWindow::create(); 
     1653             
     1654            if(!composerType.empty()) 
     1655            { 
     1656                FieldContainerPtr fcPtr =  
     1657                    FieldContainerFactory::the()-> 
     1658                    createFieldContainer(composerType.c_str()); 
     1659                ImageComposerPtr icPtr = cast 
     1660                    _dynamic<ImageComposerPtr>(fcPtr); 
     1661                 
     1662                if(icPtr != NullFC) 
    16571663                { 
    1658                     FieldContainerPtr fcPtr =  
    1659                         FieldContainerFactory::the()-> 
    1660                         createFieldContainer(composerType.c_str()); 
    1661                     ImageComposerPtr icPtr = cast 
    1662                         _dynamic<ImageComposerPtr>(fcPtr); 
    1663  
    1664                     if(icPtr != NullFC) 
    1665                     { 
    16661664/* 
    1667                         if(PipelineComposerPtr::dcast(icPtr) != NullFC) 
    1668                             PipelineComposerPtr::dcast(icPtr)->setTileSize(subtilesize); 
    1669                         if(BinarySwapComposerPtr::dcast(icPtr) != NullFC) 
    1670                             BinarySwapComposerPtr::dcast(icPtr)->setTileSize(subtilesize); 
    1671 */ 
    1672                         icPtr->setStatistics(info); 
     1665  if(PipelineComposerPtr::dcast(icPtr) != NullFC) 
     1666  PipelineComposerPtr::dcast(icPtr)->setTileSize(subtilesize); 
     1667  if(BinarySwapComposerPtr::dcast(icPtr) != NullFC) 
     1668  BinarySwapComposerPtr::dcast(icPtr)->setTileSize(subtilesize); 
     1669 */ 
     1670                    icPtr->setStatistics(info); 
    16731671//                        icPtr->setShort(false); 
    1674                         sortlast->setComposer(icPtr); 
    1675                     } 
     1672                    sortlast->setComposer(icPtr); 
    16761673                } 
    1677                 clusterWindow=sortlast; 
    1678                 break; 
     1674            } 
     1675            clusterWindow=sortlast; 
     1676            break; 
    16791677#endif 
    16801678#ifdef FRAMEINTERLEAVE 
    1681             case 'I': 
    1682                 frameinterleave=FrameInterleaveWindow::create(); 
    1683                 clusterWindow=frameinterleave; 
    1684                 if(compose) 
    1685                     frameinterleave->setCompose(true); 
    1686                 else 
    1687                     frameinterleave->setCompose(false); 
    1688                 break; 
     1679        case 'I': 
     1680            frameinterleave=FrameInterleaveWindow::create(); 
     1681            clusterWindow=frameinterleave; 
     1682            if(compose) 
     1683                frameinterleave->setCompose(true); 
     1684            else 
     1685                frameinterleave->setCompose(false); 
     1686            break; 
    16891687#endif 
    16901688#ifdef HAVE_SORT 
    1691             case 'P': 
    1692                 sortfirst=SortFirstWindow::create(); 
    1693                 sortfirst->setCompose(false); 
    1694                 clusterWindow=sortfirst; 
    1695                 break; 
     1689        case 'P': 
     1690            sortfirst=SortFirstWindow::create(); 
     1691            sortfirst->setCompose(false); 
     1692            clusterWindow=sortfirst; 
     1693            break; 
    16961694#endif 
    1697        
    1698  
    1699             if(!autostart.empty()) 
    1700                 clusterWindow->editAutostart().push_back(autostart); 
    1701  
    1702             for(i=0 ; i<servers.size() ; ++i) 
    1703                 clusterWindow->editServers().push_back(servers[i]); 
    1704             switch(type) 
    1705            
    1706                 case 'M':  
    1707                     multidisplay->setHServers( 
    1708                         clusterWindow->getServers().size()/rows); 
    1709                     multidisplay->setVServers( 
    1710                         rows); 
    1711                     break; 
    1712            
     1695   
     1696     
     1697    if(!autostart.empty()) 
     1698        clusterWindow->editAutostart().push_back(autostart); 
     1699     
     1700    for(i=0 ; i<servers.size() ; ++i) 
     1701        clusterWindow->editServers().push_back(servers[i]); 
     1702    switch(type) 
     1703   
     1704        case 'M':  
     1705            multidisplay->setHServers( 
     1706                clusterWindow->getServers().size()/rows); 
     1707            multidisplay->setVServers( 
     1708                rows); 
     1709            break; 
     1710   
    17131711#ifdef FRAMEINTERLEAVE 
    1714             clusterWindow->setInterleave(interleave); 
     1712    clusterWindow->setInterleave(interleave); 
    17151713#endif 
    1716  
    1717         // create client window 
    1718         clientWindow=GLUTWindow::create(); 
     1714     
     1715    // create client window 
     1716    clientWindow=GLUTWindow::create(); 
    17191717//        glutReshapeWindow(800,600); 
    1720         glutReshapeWindow(winwidth,winheight); 
    1721         clientWindow->setGlutId(winid); 
    1722         clientWindow->init(); 
    1723  
    1724         // init scene graph 
    1725         init(filenames); 
    1726  
    1727         // init client 
    1728         clusterWindow->setConnectionType(connectionType); 
    1729         // needs to be called before init()! 
    1730         clusterWindow->setConnectionParams(connectionParameters); 
    1731         if(clientRendering) 
    1732         { 
    1733             clusterWindow->setClientWindow(clientWindow); 
    1734         } 
    1735         clusterWindow->init(); 
    1736         clusterWindow->resize(winwidth,winheight); 
    1737         clientWindow->resize(winwidth,winheight); 
    1738         clusterWindow->setConnectionDestination(connectionDestination); 
    1739         clusterWindow->setConnectionInterface(connectionInterface); 
    1740         glutMainLoop(); 
    1741     } 
    1742     catch(OSG_STDEXCEPTION_NAMESPACE::exception &e) 
    1743     { 
    1744         SLOG << e.what() << std::endl; 
    1745     } 
     1718    glutReshapeWindow(winwidth,winheight); 
     1719    clientWindow->setGlutId(winid); 
     1720    clientWindow->init(); 
     1721     
     1722    // init scene graph 
     1723    init(filenames); 
     1724     
     1725    // init client 
     1726    clusterWindow->setConnectionType(connectionType); 
     1727    // needs to be called before init()! 
     1728    clusterWindow->setConnectionParams(connectionParameters); 
     1729    if(clientRendering) 
     1730    { 
     1731        clusterWindow->setClientWindow(clientWindow); 
     1732    } 
     1733    clusterWindow->init(); 
     1734    clusterWindow->resize(winwidth,winheight); 
     1735    clientWindow->resize(winwidth,winheight); 
     1736    clusterWindow->setConnectionDestination(connectionDestination); 
     1737    clusterWindow->setConnectionInterface(connectionInterface); 
     1738     
    17461739    return 0; 
    17471740} 
    17481741 
    1749  
    1750  
    1751  
    1752  
    1753  
    1754  
     1742int main(int argc,char **argv) 
     1743
     1744    doMain(argc, argv); 
     1745 
     1746    glutMainLoop(); 
     1747 
     1748    return 0; 
     1749
     1750 
     1751 
     1752 
     1753 
     1754 
     1755 
     1756 
  • trunk/Source/Contrib/VTK/testVTKClusterConnect.cpp

    r1167 r1176  
    567567 
    568568// Initialize GLUT & OpenSG and set up the scene 
    569 int main(int argc, char **argv) 
     569int doMain(int argc, char **argv) 
    570570{ 
    571571    std::cout << "start a cluster server with './testClusterServer -w pipe0'\n" 
     
    630630    _mgr->showAll(); 
    631631     
     632 
     633    return 0; 
     634} 
     635 
     636// Initialize GLUT & OpenSG and set up the scene 
     637int main(int argc, char **argv) 
     638{ 
     639    doMain(argc, argv); 
     640 
    632641    // GLUT main loop 
    633642    glutMainLoop(); 
  • trunk/Source/System/Cluster/Base/testClusterClient.cpp

    r1160 r1176  
    932932} 
    933933 
    934 int main(int argc,char **argv) 
     934int doMain(int argc,char **argv) 
    935935{ 
    936936    int                      i; 
     
    11411141        } 
    11421142    } 
    1143     try 
    1144     { 
    1145         osgInit(argc, argv); 
    1146         glutInit(&argc, argv); 
    1147         glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); 
    1148         if(winx >=0 && winy >=0) 
    1149             glutInitWindowPosition(winx,winy); 
    1150         glutInitWindowSize(winwidth,winheight); 
    1151         winid = glutCreateWindow("OpenSG Cluster Client"); 
    1152         glutKeyboardFunc(key); 
    1153         glutReshapeFunc(reshape); 
    1154         glutDisplayFunc(display);      
    1155         if(animate) 
    1156             glutIdleFunc(display);        
    1157         glutMouseFunc(mouse);    
    1158         glutMotionFunc(motion);  
    1159         ract = RenderAction::create(); 
     1143 
     1144    osgInit(argc, argv); 
     1145    glutInit(&argc, argv); 
     1146    glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE ); 
     1147    if(winx >=0 && winy >=0) 
     1148        glutInitWindowPosition(winx,winy); 
     1149    glutInitWindowSize(winwidth,winheight); 
     1150    winid = glutCreateWindow("OpenSG Cluster Client"); 
     1151    glutKeyboardFunc(key); 
     1152    glutReshapeFunc(reshape); 
     1153    glutDisplayFunc(display);      
     1154    if(animate) 
     1155        glutIdleFunc(display);        
     1156    glutMouseFunc(mouse);    
     1157    glutMotionFunc(motion);  
     1158    ract = RenderAction::create(); 
    11601159#ifdef OSG_OLD_RENDER_ACTION 
    1161         ract->setSortTrans(true); 
    1162         ract->setZWriteTrans(true); 
    1163         ract->setLocalLights(true); 
    1164         ract->setCorrectTwoSidedLighting(true); 
     1160    ract->setSortTrans(true); 
     1161    ract->setZWriteTrans(true); 
     1162    ract->setLocalLights(true); 
     1163    ract->setCorrectTwoSidedLighting(true); 
    11651164#endif 
    11661165 
    1167         // clear changelist from prototypes 
    1168         OSG::Thread::getCurrentChangeList()->clear(); 
    1169          
    1170         // create cluster window 
    1171         switch(type) 
    1172         { 
    1173             case 'M':  
    1174                 multidisplay=MultiDisplayWindow::create(); 
    1175                 clusterWindow=multidisplay; 
    1176                 break; 
    1177             case 'X':  
    1178                 balancedmultidisplay=BalancedMultiWindow::create(); 
    1179                 clusterWindow=balancedmultidisplay; 
    1180                 break; 
    1181             case 'F': 
    1182                 sortfirst=SortFirstWindow::create(); 
    1183                 if(compose) 
    1184                     sortfirst->setCompose(true); 
    1185                 else 
    1186                     sortfirst->setCompose(false); 
    1187                 clusterWindow=sortfirst; 
    1188                 break; 
    1189             case 'L': 
    1190                 sortlast=SortLastWindow::create(); 
    1191                 if(!composerType.empty()) 
     1166    // clear changelist from prototypes 
     1167    OSG::Thread::getCurrentChangeList()->clear(); 
     1168     
     1169    // create cluster window 
     1170    switch(type) 
     1171    { 
     1172        case 'M':  
     1173            multidisplay=MultiDisplayWindow::create(); 
     1174            clusterWindow=multidisplay; 
     1175            break; 
     1176        case 'X':  
     1177            balancedmultidisplay=BalancedMultiWindow::create(); 
     1178            clusterWindow=balancedmultidisplay; 
     1179            break; 
     1180        case 'F': 
     1181            sortfirst=SortFirstWindow::create(); 
     1182            if(compose) 
     1183                sortfirst->setCompose(true); 
     1184            else 
     1185                sortfirst->setCompose(false); 
     1186            clusterWindow=sortfirst; 
     1187            break; 
     1188        case 'L': 
     1189            sortlast=SortLastWindow::create(); 
     1190            if(!composerType.empty()) 
     1191            { 
     1192                FieldContainerUnrecPtr fcPtr =  
     1193                    FieldContainerFactory::the()-> 
     1194                    createContainer(composerType.c_str()); 
     1195                ImageComposerPtr icPtr =  
     1196                    dynamic_cast<ImageComposerPtr>(fcPtr.get()); 
     1197                 
     1198                if(icPtr != NullFC) 
    11921199                { 
    1193                     FieldContainerUnrecPtr fcPtr =  
    1194                         FieldContainerFactory::the()-> 
    1195                             createContainer(composerType.c_str()); 
    1196                     ImageComposerPtr icPtr =  
    1197                         dynamic_cast<ImageComposerPtr>(fcPtr.get()); 
    1198  
    1199                     if(icPtr != NullFC) 
     1200                    if(dynamic_cast<PipelineComposerPtr>(icPtr) != NullFC) 
    12001201                    { 
    1201                         if(dynamic_cast<PipelineComposerPtr>(icPtr) != NullFC) 
    1202                         { 
    1203                             if(subtilesize>0) 
    1204                                 dynamic_cast<PipelineComposerPtr>(icPtr)->setTileSize(subtilesize); 
    1205                             dynamic_cast<PipelineComposerPtr>(icPtr)->setPipelined(pipelinedBufferRead); 
    1206                         } 
    1207                         if(dynamic_cast<BinarySwapComposerPtr>(icPtr) != NullFC) 
    1208                         { 
    1209                             if(subtilesize>0) 
    1210                                 dynamic_cast<BinarySwapComposerPtr>(icPtr)->setTileSize(subtilesize); 
    1211                         } 
    1212                         icPtr->setStatistics(info); 
     1202                        if(subtilesize>0) 
     1203                            dynamic_cast<PipelineComposerPtr>(icPtr)->setTileSize(subtilesize); 
     1204                        dynamic_cast<PipelineComposerPtr>(icPtr)->setPipelined(pipelinedBufferRead); 
     1205                    } 
     1206                    if(dynamic_cast<BinarySwapComposerPtr>(icPtr) != NullFC) 
     1207                    { 
     1208                        if(subtilesize>0) 
     1209                            dynamic_cast<BinarySwapComposerPtr>(icPtr)->setTileSize(subtilesize); 
     1210                    } 
     1211                    icPtr->setStatistics(info); 
    12131212//                        icPtr->setShort(false); 
    1214                         sortlast->setComposer(icPtr); 
    1215                     } 
     1213                    sortlast->setComposer(icPtr); 
    12161214                } 
    1217                 clusterWindow=sortlast; 
    1218                 break; 
     1215            } 
     1216            clusterWindow=sortlast; 
     1217            break; 
    12191218#ifdef FRAMEINTERLEAVE 
    1220             case 'I': 
    1221                 frameinterleave=FrameInterleaveWindow::create(); 
    1222                 clusterWindow=frameinterleave; 
    1223                 if(compose) 
    1224                     frameinterleave->setCompose(true); 
    1225                 else 
    1226                     frameinterleave->setCompose(false); 
    1227                 break; 
     1219        case 'I': 
     1220            frameinterleave=FrameInterleaveWindow::create(); 
     1221            clusterWindow=frameinterleave; 
     1222            if(compose) 
     1223                frameinterleave->setCompose(true); 
     1224            else 
     1225                frameinterleave->setCompose(false); 
     1226            break; 
    12281227#endif 
    1229             case 'P': 
    1230                 sortfirst=SortFirstWindow::create(); 
    1231                 sortfirst->setCompose(false); 
    1232                 clusterWindow=sortfirst; 
    1233                 break; 
    1234        
    1235  
    1236         if(!autostart.empty()) 
    1237             clusterWindow->editAutostart().push_back(autostart); 
    1238          
    1239         for(i=0 ; i<servers.size() ; ++i) 
    1240             clusterWindow->editServers().push_back(servers[i]); 
    1241         if(cols < 0) 
    1242             cols = clusterWindow->getServers().size() / rows; 
    1243         switch(type) 
    1244        
    1245             case 'M':  
    1246                 multidisplay->setHServers(cols); 
    1247                 multidisplay->setVServers(rows); 
    1248                 break; 
    1249             case 'X':  
    1250                 balancedmultidisplay->setHServers(cols); 
    1251                 balancedmultidisplay->setVServers(rows); 
     1228        case 'P': 
     1229            sortfirst=SortFirstWindow::create(); 
     1230            sortfirst->setCompose(false); 
     1231            clusterWindow=sortfirst; 
     1232            break; 
     1233   
     1234     
     1235    if(!autostart.empty()) 
     1236        clusterWindow->editAutostart().push_back(autostart); 
     1237     
     1238    for(i=0 ; i<servers.size() ; ++i) 
     1239        clusterWindow->editServers().push_back(servers[i]); 
     1240    if(cols < 0) 
     1241        cols = clusterWindow->getServers().size() / rows; 
     1242    switch(type) 
     1243   
     1244        case 'M':  
     1245            multidisplay->setHServers(cols); 
     1246            multidisplay->setVServers(rows); 
     1247            break; 
     1248        case 'X':  
     1249            balancedmultidisplay->setHServers(cols); 
     1250            balancedmultidisplay->setVServers(rows); 
    12521251//                    balancedmultidisplay->setShowBalancing(true); 
    1253                 balancedmultidisplay->setShowBalancing(info); 
    1254                 break; 
    1255        
     1252            balancedmultidisplay->setShowBalancing(info); 
     1253            break; 
     1254   
    12561255#ifdef FRAMEINTERLEAVE 
    1257         clusterWindow->setInterleave(interleave); 
     1256    clusterWindow->setInterleave(interleave); 
    12581257#endif 
    12591258         
    1260         // create client window 
    1261         clientWindow=GLUTWindow::create(); 
     1259    // create client window 
     1260    clientWindow=GLUTWindow::create(); 
    12621261//        glutReshapeWindow(800,600); 
    1263         glutReshapeWindow(winwidth,winheight); 
    1264         clientWindow->setGlutId(winid); 
    1265         clientWindow->init(); 
    1266  
    1267         // init scene graph 
    1268         init(filenames); 
    1269  
    1270         // init client 
    1271         clusterWindow->setConnectionType(connectionType); 
    1272         // needs to be called before init()! 
    1273         clusterWindow->setConnectionParams(connectionParameters); 
    1274         if(clientRendering) 
    1275         { 
    1276             clusterWindow->setClientWindow(clientWindow); 
    1277         } 
    1278         clusterWindow->setConnectionDestination(connectionDestination); 
    1279         clusterWindow->setConnectionInterface(connectionInterface); 
    1280         clusterWindow->init(); 
    1281         if(serverx > 0) 
    1282             clusterWindow->resize(serverx,servery); 
    1283         else 
    1284             clusterWindow->resize(winwidth,winheight); 
    1285         clientWindow->resize(winwidth,winheight); 
    1286         glutMainLoop(); 
    1287     } 
    1288     catch(OSG_STDEXCEPTION_NAMESPACE::exception &e) 
    1289     { 
    1290         SLOG << e.what() << std::endl; 
    1291     } 
     1262    glutReshapeWindow(winwidth,winheight); 
     1263    clientWindow->setGlutId(winid); 
     1264    clientWindow->init(); 
     1265     
     1266    // init scene graph 
     1267    init(filenames); 
     1268     
     1269    // init client 
     1270    clusterWindow->setConnectionType(connectionType); 
     1271    // needs to be called before init()! 
     1272    clusterWindow->setConnectionParams(connectionParameters); 
     1273    if(clientRendering) 
     1274    { 
     1275        clusterWindow->setClientWindow(clientWindow); 
     1276    } 
     1277    clusterWindow->setConnectionDestination(connectionDestination); 
     1278    clusterWindow->setConnectionInterface(connectionInterface); 
     1279    clusterWindow->init(); 
     1280    if(serverx > 0) 
     1281        clusterWindow->resize(serverx,servery); 
     1282    else 
     1283        clusterWindow->resize(winwidth,winheight); 
     1284    clientWindow->resize(winwidth,winheight); 
     1285    glutMainLoop(); 
     1286 
    12921287    return 0; 
    12931288} 
    12941289 
    1295  
    1296  
    1297  
    1298  
    1299  
    1300  
     1290int main(int argc,char **argv) 
     1291
     1292    doMain(argc, argv); 
     1293 
     1294    glutMainLoop(); 
     1295 
     1296    return 0; 
     1297
     1298 
     1299 
     1300 
     1301 
     1302 
  • trunk/Source/System/Cluster/Base/testDynamicClusterClient.cpp

    r1141 r1176  
    4444 
    4545// Initialize GLUT & OpenSG and set up the scene 
    46 int main(int argc, char **argv) 
     46int doMain(int argc, char **argv) 
    4747{ 
    4848    std::cout << "start a cluster server with './testClusterServer -w pipe0'\n" 
     
    104104    _mgr->showAll(); 
    105105     
    106     // GLUT main loop 
     106    return 0; 
     107
     108 
     109int main(int argc, char **argv) 
     110
     111    doMain(argc, argv); 
     112 
    107113    glutMainLoop(); 
    108114 
  • trunk/Source/System/FieldContainer/Base/OSGAttachmentContainer.cpp

    r1174 r1176  
    175175    key = (UInt32 (pAttachment->getGroupId()) << 16) | binding; 
    176176 
    177     pAttachment->addReferenceX(); 
     177    pAttachment->addReferenceUnrecordedX(); 
    178178 
    179179    pAttachment->linkParent(this,  
     
    190190                                    FieldContainerAttachment::ParentsFieldId); 
    191191 
    192         (*fcI).second->subReferenceX(); 
     192        (*fcI).second->subReferenceUnrecordedX(); 
    193193 
    194194        (*fcI).second = pAttachment; 
     
    233233                                    FieldContainerAttachment::ParentsFieldId); 
    234234 
    235         (*fcI).second->subReferenceX(); 
     235        (*fcI).second->subReferenceUnrecordedX(); 
    236236 
    237237        _sfAttachments.getValue().erase(fcI); 
     
    293293                                    FieldContainerAttachment::ParentsFieldId); 
    294294 
    295         (*fcI).second->subReferenceX(); 
     295        (*fcI).second->subReferenceUnrecordedX(); 
    296296 
    297297        ++fcI; 
  • trunk/Source/System/FieldContainer/Fields/OSGAttachmentMapFieldTraits.h

    r1105 r1176  
    185185         
    186186        pMem.getValue(size); 
     187 
     188 
     189        FieldContainerAttachmentMap::const_iterator mapIt  =  
     190            aMap.begin(); 
     191 
     192        FieldContainerAttachmentMap::const_iterator mapEnd =  
     193            aMap.begin(); 
     194 
     195        for(; mapIt != mapEnd; ++mapIt) 
     196        { 
     197            if((*mapIt).second != NullFC) 
     198            { 
     199                Thread::getCurrentChangeList()->addDelayedSubRef< 
     200                    UnrecordedRefCountPolicy>((*mapIt).second); 
     201            } 
     202        } 
     203         
    187204        aMap.clear(); 
     205 
    188206         
    189207        for(UInt32 i = 0; i < size; ++i) 
     
    196214             
    197215            key = (static_cast<UInt32>(attPtr->getGroupId()) << 16) | binding; 
    198              
     216 
     217            UnrecordedRefCountPolicy::addRef(attPtr); 
     218 
    199219            aMap.insert(FieldContainerAttachmentMap::value_type(key, attPtr)); 
    200220        } 
  • trunk/Source/System/NodeCores/Groups/DynamicStateGenerators/testCubemapGenerator.cpp

    r1105 r1176  
    355355} 
    356356 
    357 int main (int argc, char **argv) 
     357int doMain (int argc, char **argv) 
    358358{ 
    359359    osgInit(argc,argv); 
     
    581581    tball.setRotationCenter  (tCenter             ); 
    582582 
     583     
     584    return 0; 
     585} 
     586 
     587int main (int argc, char **argv) 
     588{ 
     589    doMain(argc, argv); 
     590 
    583591    // run... 
    584592    glutMainLoop(); 
    585      
     593 
    586594    return 0; 
    587595} 
    588  
  • trunk/Source/WindowSystem/GLUT/testWindowGLUT.cpp

    r1105 r1176  
    6161ChunkOverrideGroupRecPtr pCOver; 
    6262 
     63GLUTWindowUnrecPtr gwin; 
     64 
    6365Trackball tball; 
    6466 
     
    221223            pPoly       = NullFC; 
    222224            pCOver      = NullFC; 
     225            gwin        = NullFC; 
    223226 
    224227            delete rentravact; 
    225228 
    226              
    227  
    228229            osgExit();  
     230 
    229231            exit(0); 
    230232        case 'a':    
     
    318320 
    319321 
    320 int main (int argc, char **argv) 
     322int init(int argc, char **argv) 
    321323{ 
    322324    osgInit(argc,argv); 
     
    514516    std::cout << "GLUT winid: " << winid << std::endl; 
    515517 
    516     GLUTWindowUnrecPtr gwin; 
    517518 
    518519    GLint glvp[4]; 
     
    597598#endif 
    598599 
     600    return 0; 
     601} 
     602 
     603int main (int argc, char **argv) 
     604{ 
     605    init(argc, argv); 
     606 
    599607    glutMainLoop(); 
    600608