[osg-users] osgtext::text::settext()

Cyril Brulebois cyril.brulebois at kerlabs.com
Sun Nov 15 18:23:54 PST 2009

Wu Hui <wuhui19870418 at 163.COM> (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.

Cyril Brulebois
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091116/7d247de2/attachment.pgp>

More information about the osg-users mailing list