Hi Roni,

You can't remove an object while its being operated on, so you need to
change you code so that the event handler sets an operation that you
main loops does at a safe time.  You'll need to stop and start
threading as well to avoid threads still using the view when you
remove it, so do something like:


  while(!viewer.done())
  {
     viewer.advance();
     viewer.eventTraversal();
     viewer.updateTraversal();

     if (needToDoSpecialViewerOperation)
     {
         viewer.stopThreading();
         // do my special operations...
         viewer.startThreading();
     }
     viewer.renderingTraversals();
  }

On Wed, Mar 12, 2008 at 11:29 AM, Roni Rosenzweig <[EMAIL PROTECTED]> wrote:
> Hello
> I added an event handler for dynamically removing a view during the run.
> However it crashes because in CompostieViewer::eventTraversals, after the
> call to the event handler (which removes the view hence it's deleted)
> there's another usage of the view, which is already deleted (there's a call
> to the matrix manipulator).
> Is there a way to overcome this problem so that views can by removed during
> the run by an event handler?
> Roni
> _______________________________________________
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to