[osg-users] Error: 'Debug Assertion Failure!'
Gordon Tomlinson
gordon at gordon-tomlinson.com
Thu Jan 3 08:08:04 PST 2008
I think you need to set your (*ponto_itr) to NULL or remove it from the
vector after you have done the remove child, other wise the pointer still
has the address of the child you previously removed so you for loop above
(ponto_limp) will never do any thing
__________________________________________________________
Gordon Tomlinson
Email : gordon at GordonTomlinson.com
Website : www.vis-sim.com www.gordontomlinson.com
__________________________________________________________
"Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival"
-Master Tambo Tetsura
_____
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Renan
Mendes
Sent: 03 January 2008 14:43
To: OpenSceneGraph Users
Subject: [Norton AntiSpam] Re: [osg-users] Error: 'Debug Assertion Failure!'
Hi, Rafa,
I've tried doing something like what you've said before: every time
before I checked for selections with verifySelection(), I searched for a
NULL member and erased it, like it's done below. Can you tell me why it
still isn't working? Is there a logical flaw in my code?
Thanks,
Renan M Z Mendes
case(osgGA::GUIEventAdapter::KEYDOWN):
{
if(!ponto.empty())
{
for(ponto_limp = ponto.begin(); ponto_limp !=
ponto.end(); ponto_limp++)
{
if(*ponto_limp == NULL)
{
ponto.erase(ponto_limp);
}
}
for(ponto_itr = ponto.begin(); ponto_itr != ponto.end();
ponto_itr++)
{
if((*ponto_itr)->verifySelection())
{
switch(ea.getKey())
{
case(ea.KEY_Delete):
{
osg::Group* root =
(*ponto_itr)->getParent(0);
root->removeChild(root->getChildIndex((*ponto_itr)), 1);
}
}
}
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080103/1caa8f61/attachment-0001.html
More information about the osg-users
mailing list