Hi Robert,
thanks for your quick reply. I really appreciate your afford on OSG!
I'm aware of osg::ref_ptr and the application uses them everywhere it can.
I'll review the code but I think there is no tricky pointer stuff going
on there.
Is it safe to modify the SG after the updateTraversal() in
SingleThreaded mode?
Mathias
On 03.02.2011 20:28, Robert Osfield wrote:
Hi Mathias,
This sounds rather like you've got a dangling pointer somewhere in
your app. The OSG uses reference counting for all the internal scene
graph objects which is specifically to avoid dangling pointers and to
leverage this safely you are best to use ref_ptr<> to all OSG objects.
Lots has been discussed about ref_ptr<> over the years so have a
search through the archives.
Robert.
On Thu, Feb 3, 2011 at 7:12 PM, Mathias Buhr<[email protected]> wrote:
Hi,
I'm experiencing a strange segfault with an inherited osg::Drawable.
Unfortunately I'm currently unable to provide an example demonstrating this.
The application is a clustered rendering system and for various reasons I
have to (un-)load scenes during runtime. These scenes are implemented as
plugins (shared objects). The application implements an "unrolled" frame()
loop and (un-)loading these scenes happens after the call to
updateTraversal().
The whole system is generally working but a newly created scene is somehow
problematic. The scenes consists only of a reimplemented osg::Drawable where
basically only drawImplementation() is overwritten. This drawable renders a
simple wire cube and display lists are disabled (so drawImplementation() is
called every frame). Rendering this scene works fine.
Unloading and deletion of the shared object and its related data works
almost fine but the application crashes in unref() of a drawable during the
next cull traversal. Notice the "a" as I'm not entirely sure which drawable
is the problem (afaik there is only one).
The really strange thing is that the destructor of my drawable isn't called.
If I additionally call ref() on this object the segfault disappears but the
destructor still won't get called. The problem seems to be independent of
the threading mode. I've tried singlethreaded and could verify (via
debugger) that no threads where running during the removal of the sceneroot
of the shared object.
How is it possible that the next cull traversal reaches this drawable when
it is removed from my scene root before the call to renderingTraversals()?
Is there anything obvious missing?
Is there anything happening in the rendering backend that I should be aware
of?
I haven't build OSG in debug mode but probably I'll try this next. Maybe
this will provide some useful insights.
I appreciate any idea on this.
Best regards and thanks in advance
Mathias Buhr
_______________________________________________
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
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org