It's not the functions you are calling, you are incorrectly mixing
different C runtime libraries.

When you are using windows, you must use debug builds of OSG with your
debug build application.
And release builds with release.

If you mix the 2 then objects get allocated from different heaps and
bad things happen.

The debug builds of OSG have the letter d appended to them.
Check the settings in one of the example projects if you are not sure
what to do.

2008/12/23 Francesco Argese <kekk...@gmail.com>:
> Hi all,
>
> i'm trying to implement PickHandler in my application with osg 1.2.
> Following example osg::pick i have written the following lines of
> code:
>
> bool PickHandler::pick (const double x, const double y,
> osgProducer::Viewer* viewer)
> {
> std::vector<osgUtil::Hit> hlist;
> if ( viewer->computeIntersections(x, y, hlist) )
> {
>       //Here i handle the information recovered from computeIntersections()
>        hlist.clear();
> }
> return true;
> }
>
> Im working under Windows: the resulting application works well if i
> compile it in release mode but when use in debug mode it give me the
> following error on instruction hlist.clear(). If i don't call this
> instruction it give me the same error at the return (because the
> application try to empty Heap).
>
> Debug Assertion Failed
> File:dbddel.cpp
> Line:52
>
> Exception: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse).
>
> I have tried to comment the code containing computeIntersection and
> all works well. It seems that computeIntersections function do
> something on hlist, avoiding to empty memory.
>
> How can i resolve this problem? Does exist another functionto to have
> the same behaviour? How can i try to resolve this problem?
>
> Thanke in advance
> Francesco Argese
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
The truth is out there. Usually in header files.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to