Show
Ignore:
Timestamp:
06/30/07 16:28:24 (7 years ago)
Author:
robert
Message:

Added debug path that creates the viewer on the heap.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgteapot/osgteapot.cpp

    r6941 r7053  
    333333int main(int , char **) 
    334334{ 
     335#if 1     
     336 
     337    // create viewer on heap as a test, this looks to be causing problems 
     338    // on init on some platforms, and seg fault on exit when multi-threading on linux.    
     339    // Normal stack based version below works fine though...  
     340 
     341    // construct the viewer. 
     342    osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer; 
     343 
     344    // add model to viewer. 
     345    viewer->setSceneData( createTeapot() ); 
     346 
     347    // create the windows and run the threads. 
     348    return viewer->run(); 
     349     
     350#else 
     351 
    335352    // construct the viewer. 
    336353    osgViewer::Viewer viewer; 
     
    341358    // create the windows and run the threads. 
    342359    return viewer.run(); 
     360 
     361#endif 
     362 
    343363}