Cyril Brulebois wrote: > Wu Hui <> (16/11/2009): > > > I add an Text to the HUD, and want to updata this text every frame > > in a callback function using settext every frame. However, the > > program will crash, the error is " map/set not dereferenceable" > > "vector iterator not decrementable " or something in Wincore.cpp .I > > think this must have something to do with the source code of the > > Text implementation. Would someone tell me how this problem happen? > > > > IIRC it's possible to get errors that may look like bugs in OSG > itself, but it also can mean you're not doing things right. > > Wild guess: > - you're trying to update the text while it's being used elsewhere in > the code, resulting in broken pointers/reference count, etc. > > You could try: > - to set the Data Variance for this object to DYNAMIC, telling the > framework you might update this text object at any moment. > - to update the text at a more appropriate time, differentiating > between the various traversals. > > That's based on my recollection before using proper callbacks. The > former is probably a quick way to get things working. The latter is > probably better in the long run once you're comfortable with various > concepts in OSG. > > Cheers, > -- > Cyril Brulebois > > _______________________________________________ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ------------------ > Post generated by Mail2Forum
Thank you a lot , your advice is really helpful. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=19703#19703 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

