Added debug path that creates the viewer on the heap.

This commit is contained in:
Robert Osfield 2007-06-30 14:28:24 +00:00
parent c80313ccd0
commit 7dd9ea7a30

View File

@ -332,6 +332,23 @@ osg::Geode* createTeapot()
int main(int , char **) int main(int , char **)
{ {
#if 1
// create viewer on heap as a test, this looks to be causing problems
// on init on some platforms, and seg fault on exit when multi-threading on linux.
// Normal stack based version below works fine though...
// construct the viewer.
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
// add model to viewer.
viewer->setSceneData( createTeapot() );
// create the windows and run the threads.
return viewer->run();
#else
// construct the viewer. // construct the viewer.
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
@ -340,4 +357,7 @@ int main(int , char **)
// create the windows and run the threads. // create the windows and run the threads.
return viewer.run(); return viewer.run();
#endif
} }