Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer

2012-12-20 Thread Daniel Schmid
Hi Robert I tried with dynamic_cast and also with reinterpret_cast. Both didn't give me the correct pointer. Could it be that with multiple inheriance it is not working correctly? CullVisitor is derived from NodeVisitor AND CullStack... Finally I created my own map of the following type: typede

Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer

2012-12-20 Thread Robert Osfield
HI Daniel, The CullVisitor's no matching is an odd one. Any chance it's an issue of virtual inheritance somewhere along the line. Do you try a dynamic_cast to CullVistor on the object deleted? Robert. On 20 December 2012 08:27, Daniel Schmid wrote: > Hi Robert > > Sounds like a good idea to u

Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer

2012-12-20 Thread Daniel Schmid
Hi Robert Sounds like a good idea to use observers. I just did the following: - Derived my customized ViewDependentShadowMap class also from Observer. - override the createViewDependentData method to add this-ptr to CullVisitors observers - implemented Observers objectDeleted method to remove t

Re: [osg-users] ViewDependentShadowMap memory leaks with CompositeViewer

2012-12-19 Thread Robert Osfield
HI Daniel, I'm afraid I don't have the time right now to look into this. It sounds like osgShadow will need to clean up the ViewDepedentData structures when a View/CullVisitor is deleted. I'd guess we'd need to introduce a local observer_ptr<> or osg::Obsever to catch when the CullVisitor gets d

[osg-users] ViewDependentShadowMap memory leaks with CompositeViewer

2012-12-19 Thread Daniel Schmid
Hi Robert, Wang Rui, and all I discovered a great gpu memory wasting in ViewDependentShadowMap. I use CompositeViewer with dynamically adding/removing view, and one global scene graph for all views. ViewDependentShadowMap uses ViewDependentData to store the shadows etc. These Data are stored