[Fresco-devel] some fixes for client-exit-problems

[email protected] Sun, 19 Oct 2003 14:02:51 +0200
Newsgroups gmane.comp.video.fresco.devel
Message-ID <20031019120251.GA775@balthasar>
hi again ;)

i may fixed some exit-problems...

problem:
if you interact with clients while this clients exit the server tends to crash. for example click
at [X] and try to move the window as fast as you can... as far as i see the problem is if
the EventManager wants to damage a always dead graphic... i simply fix this by inserting the
(*i)->damage(r); call in a try {} catch (const CORBA::OBJECT_NOT_EXIST &) {} block. is this the 
right place to catch this exception? i don't know...

next. here seems also a problem in the PositionalFocus implementation. if here goes something 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...

in the NonPositionalFocus implementation sutch a exception is catched and the bad controller will
removed from _controllers.

so i fixed it in PositionalFocus by inserting the dispatch statement into a try-catch-block, and
if we catch a exception the controller will be removed from _controllers before continue:

try {
  _controllers.back()->handle_positional(PickTraversal_var(_traversal->_this()), event); }
catch (const CORBA::OBJECT_NOT_EXIST &) { 
  std::cout << "PositionalEvent: warning: dispatch faild! (OBJECT_NOT_EXIST)" << std::endl; 
  _controllers.pop_back(); }
catch (const CORBA::COMM_FAILURE &) { 
  std::cout << "PositionalEvent: warning: dispatch faild! (COMM_FAILURE)" << std::endl;
  _controllers.pop_back(); }
catch (const CORBA::TRANSIENT &) { 
  std::cout << "PositionalEvent: warning: dispatch faild! (TRANSIENT)" << std::endl;
  _controllers.pop_back(); }

this worx very well for me.

mfg
cinap_lenrek