Hi,

I'm working on a project that views osg models in a Qt window. I've stripped 
down the osgviewerQtWidget example built with 2.9.9 to a single, lightweight 
class. I have an odd problem with debug/release though.

In the below code, the windowName assignment causes a crash in release, but not 
in debug. The data member 'windowName' is simply an std::string. In debug, the 
assignment is successful and the program carries on, while in release mode, the 
program hangs/crashes. 

[code]
void QOSGWidget::createContext(QWidget * parent)
{
    ...

    osg::ref_ptr<osg::GraphicsContext::Traits> traits =  new 
osg::GraphicsContext::Traits;

    ...

    traits->windowName = "qosgwidget"; //problem line
    traits->screenNum = 0;
    traits->alpha = ds->getMinimumNumAlphaBits();

    ...
}
[/code]

If I was to add the line,
[code]traits->windowName;[/code]
to my code (even though it does nothing), no crash will occur on release. Thus, 
it only crashes on release when an assignment operator is required. I've tried 
assigning character arrays and std::string variables, but no luck. 

Has anyone ever seen this before? Did I set up my debug/release project 
settings incorrectly, or is this something on the osg end?


Thank you!

Cheers,
Christian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=32481#32481





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to