[osg-users] Bug in RenderBin (?)

Paul Melis paul at science.uva.nl
Thu Mar 12 01:49:03 PDT 2009

Christof Krüger wrote:
> Hi,
> I'm new to OpenSceneGraph and not sure if I get everything right. I get crashes with Visual Studio 2005 static build after the main function returns. The crash occurs while the static s_renderBinPrototypeList is destructed.
> While debugging, I have found something suspicious:  There are two RegisterRenderBinProxy instances in RenderBin.cpp, one with the name "RenderBin" and one with "DepthSortedBin". They both add the corresponding entries to the s_renderBinPrototypeList correctly before main() enters.
> However, the s_registerDepthSortedBinProxy removes the wrong entry in s_renderBinPrototypeList afterwards. This happens because the proxy class calls removeRenderBinPrototype which uses proto->className to find the entry to erase from the s_renderBinPrototypeList map. Remember that the destructor of s_registerDepthSortedBinProxy should remove the "DepthSortedBin" entry. Unfortunately, proto->className equals "RenderBin" in both cases.
> When s_registerRenderBinProxy tries to delete the "RenderBin" entry later, it fails because it is already deleted. Then, s_renderBinPrototypeList still contains the DepthSortedBin entry which was never deleted.
What OSG version are you using?


More information about the osg-users mailing list