[osg-users] LineSegmentIntersector LEAK-Problem?

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


Hello everyone,

I using the following code:
Is it a bug? Its used inside C++/CLI Environment but inside a pure
native class.

This was halfways copypasted from one of the examples. It's a function
inside a GUIEventHandler called in cas of a GUIEvenetAdapter::REALESE:

void pick(const osgGA::GUIEventAdapter& ea, osgViewer::Viewer* viewer)
	{
		osgUtil::LineSegmentIntersector::Intersection
intersection;
		osg::Node* scene = viewer->getSceneData();
        if (!scene) return;

		/*osg::Node* node = 0;
        osg::Group* parent = 0;*/
		osg::ref_ptr<osgUtil::LineSegmentIntersector> picker;
        picker = new osgUtil::LineSegmentIntersector(
osgUtil::Intersector::PROJECTION,
ea.getXnormalized(),ea.getYnormalized() );	

		picker->setThreadSafeReferenceCounting(true);
<---Thought this could solve the problem but didnt change anything
		picker->setThreadSafeRefUnref(true);
<----Same here
		osgUtil::IntersectionVisitor iv(picker.get());
		viewer->getCamera()->accept(iv);
		if (picker->containsIntersections())
        	{
			intersection = picker->getFirstIntersection();
<---THIS LINE THROWS AN ERROR
		}
		return;
	}


I get the following error:

The output window may have more diagnostic information.
HEAP[interfaceD.exe]: Invalid Address specified to RtlFreeHeap(
02170000, 11395350 )
Windows has triggered a breakpoint in interfaceD.exe.

This may be due to a corruption of the heap, which indicates a bug in
interfaceD.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while interfaceD.exe has
focus.

The output window may have more diagnostic information.
The program '[840] interfaceD.exe: Managed' has exited with code 0
(0x0).
The program '[840] interfaceD.exe: Native' has exited with code 0 (0x0).



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


More information about the osg-users mailing list