Fresco/Berlin/src PositionalFocus.cc,1.34,1.35

Tobias Hunger <[email protected]> Mon, 27 Oct 2003 17:53:56 +0000
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/Fresco/Berlin/src
In directory purcel:/tmp/cvs-serv8580/Berlin/src

Modified Files:
	PositionalFocus.cc 
Log Message:
Fix by cinap_lenrek (at gmx dot de):
"here seems also a problem in the PositionalFocus implementation. if here
goes wrong by dispatching the event to a controllear (wich is dead),
the controller will not be removed by the PositionalFocus and the
EventManager handels the exception as a scene graph corruption..."


Index: PositionalFocus.cc
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/src/PositionalFocus.cc,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- PositionalFocus.cc	18 Dec 2002 06:00:07 -0000	1.34
+++ PositionalFocus.cc	27 Oct 2003 17:53:53 -0000	1.35
@@ -352,6 +352,12 @@
   //   inverse_transform_vertex(position);
   // event[pidx].attr.location(position);
   // std::cout << "distributing positional event at " << position << std::endl;
-  _controllers.back()->
-    handle_positional(PickTraversal_var(_traversal->_this()), event);
+  try
+  {
+      _controllers.back()->
+        handle_positional(PickTraversal_var(_traversal->_this()), event);
+  }
+  catch (const CORBA::OBJECT_NOT_EXIST &) { _controllers.pop_back(); }
+  catch (const CORBA::COMM_FAILURE &) { _controllers.pop_back(); }
+  catch (const CORBA::TRANSIENT &) { _controllers.pop_back(); }
 }