[osg-users] LineSegmentIntersector LEAK-Problem?

Kaiser, Hagen (CT) hagen.kaiser at siemens.com
Tue Jul 22 07:14:27 PDT 2008


I traced the error now:
The function LineSegementIntersector::getFirstIntersection() executes
very well to the last bit that is:
Dereference _intersections.begin();

It jumps therefor to xtree.h :
	reference operator*() const
			{	// return designated value
			return ((reference)**(const_iterator *)this);
<--TO HERE
			}

Afterwards it jumps for a reason that i dont understand to vector
destructor and there to:

void _Tidy()
		{	// free all storage
		if (_Myfirst != 0)
			{	// something to free, destroy and
deallocate it

 #if _HAS_ITERATOR_DEBUGGING
			this->_Orphan_all();
 #endif /* _HAS_ITERATOR_DEBUGGING */

			_Destroy(_Myfirst, _Mylast);
			this->_Alval.deallocate(_Myfirst, _Myend -
_Myfirst); <--THIS IS THE POINT WHERE THE PROGRAM DIES
			}
		_Myfirst = 0, _Mylast = 0, _Myend = 0;
		}

So it tries somehow to free items in a vector that doesnt exist (?)

A solution for my pov is:
Instead of writing (picker is a LineSegementIntersector:
Picker->getFirstIntersection()->dowhatwever()
I write: 
Picker->getIntersections().begin()->dowhatever();

Still think there must be a bug somewhere at microsoft stl degubimpl or
openscenegraph.


Greetings,
Hagen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080722/2c7f5be1/attachment-0003.htm>


More information about the osg-users mailing list