[osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Paul Melis
Hi Robert, I have a situation in which I want to set the userdata of a scenegraph node to be another node, specifically one of its (indirect) parents. E.g. MyMatrixTransform (subclass of MatrixTransform) child #1: Geode drawable #1: some geometry, user data = MyMatrixTransform

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Schmidt, Richard
Mhh, you got a cyclic dependency in there anyway. Even if you resolve the setThreadSafeRefUnref call, releasing MyMatrixTransform will cause a memory leak. Solution: Don't introduce cyclic dependencies ;-) ___ osg-users mailing list

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Robert Osfield
Hi Paul, I'm afraid I can't work out the failure mechanism just be reading email. Could you provide a small code example program that could be compiled to show the problem you are seeing. Robert. On Thu, Jan 29, 2009 at 12:09 PM, Paul Melis p...@science.uva.nl wrote: Hi Robert, I have a

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Paul Melis
Hi Robert, Robert Osfield wrote: I'm afraid I can't work out the failure mechanism just be reading email. Could you provide a small code example program that could be compiled to show the problem you are seeing. Here you go. The stripped down example might not make a lot of sense, so if

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Paul Melis
Schmidt, Richard wrote: Mhh, you got a cyclic dependency in there anyway. Even if you resolve the setThreadSafeRefUnref call, releasing MyMatrixTransform will cause a memory leak. Solution: Don't introduce cyclic dependencies ;-) As long as you're aware that the cycles are there and you have

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Robert Osfield
Hi Paul, Thanks for the example. The problem in your example is your circular dependency. Right off the bat you've created a memory leak as this subgraph. The fact that you then hit a circular reference in the internal patent management is perhaps not too surprising either. You shouldn't

Re: [osg-users] Limitation on setUserData, due to setThreadSafeRefUnref()?

2009-01-29 Thread Paul Melis
Hi Robert, Robert Osfield wrote: The problem in your example is your circular dependency. Right off the bat you've created a memory leak as this subgraph. The fact that you then hit a circular reference in the internal patent management is perhaps not too surprising either. Right, although