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 <[email protected]>

> 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
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to