[osg-users] Bug in RenderBin (?)

David Callu ledocc at gmail.com
Thu Mar 12 03:13:13 PDT 2009


Hi Paul, Hi Christof


What is smells fishy is the use of "proto->className()" to identify the
renderBin prototype to remove in removeRenderBinPrototype();

<code>

void RenderBin::removeRenderBinPrototype(RenderBin* proto)
{
    RenderBinPrototypeList* list = renderBinPrototypeList();
    if (list && proto)
    {
// something wrong there
        RenderBinPrototypeList::iterator itr =
list->find(proto->className());
        if (itr != list->end()) list->erase(itr);
    }
}

</code>

proto->className() return always "RenderBin" because this is the name of the
class :).

Instead, in "void RenderBin::removeRenderBinPrototype(RenderBin* proto)" we
need something like this


<code>

void RenderBin::removeRenderBinPrototype(const std::string & binName,
RenderBin* proto)
{
    RenderBinPrototypeList* list = renderBinPrototypeList();
    if (list && proto)
    {
        RenderBinPrototypeList::iterator itr = list->find(binName);
        if (itr != list->end()) list->erase(itr);
    }
}

</code>


Thought ?


David Callu

2009/3/12 Paul Melis <paul at science.uva.nl>

> Christof Krüger wrote:
>
>> I'm using the current 2.8.0 stable release. I used the 'Browse Source' to
>> check the current trunk version of RenderBin.cpp and I see no change since.
>>
>> The actual crash occurs later in static object destruction when
>> s_renderBinPrototypeList is destructed itself. I don't understand enough of
>> osg to know what's exactly wrong. However, the s_registerDepthSortedBinProxy
>> doesn't release the object it created and this looks very suspicious to me.
>>
>>
> The fact that two different instances of RenderBin get registered under the
> same name indeed smells fishy :)
>
> Paul
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090312/a2abfdad/attachment-0003.htm>


More information about the osg-users mailing list