Discussion:
ESC key: Error: pthread_cond_destroy(, ) returned error status, status = 16
(too old to reply)
michael kapelko
2012-08-04 08:03:00 UTC
Permalink
Hi.

Can anybody please tell me how to stop osgViewer from listening to ESC
key? It frequently results into Error: pthread_cond_destroy(,)
returned error status, status = 16. I want to control ESC key myself.

Thanks.
Alberto Luaces
2012-08-04 18:38:41 UTC
Permalink
Post by michael kapelko
Hi.
Can anybody please tell me how to stop osgViewer from listening to ESC
key? It frequently results into Error: pthread_cond_destroy(,)
returned error status, status = 16. I want to control ESC key myself.
I think if you write an osgGA::GUIEventHandler that reports that you
handled the ESC key (by returning true), the viewer won't do its own
processing.
--
Alberto
Jean-Sébastien Guay
2012-08-04 21:51:50 UTC
Permalink
Post by Alberto Luaces
I think if you write an osgGA::GUIEventHandler that reports that you
handled the ESC key (by returning true), the viewer won't do its own
processing.
In addition to this, I suggest you look into the following methods of
the osgViewer::ViewerBase class (which both CompositeViewer and Viewer
inherit):

/** Set the key event that the viewer checks on each frame to
see if the viewer's done flag should be set to
* signal end of viewers main loop.
* Default value is Escape (osgGA::GUIEVentAdapter::KEY_Escape).
* Setting to 0 switches off the feature.*/
void setKeyEventSetsDone(int key) { _keyEventSetsDone = key; }
/** get the key event that the viewer checks on each frame to
see if the viewer's done flag.*/
int getKeyEventSetsDone() const { return _keyEventSetsDone; }
/** if the flag is true, the viewer set its done flag when a
QUIT_APPLICATION is received, false disables this feature */
void setQuitEventSetsDone(bool flag) { _quitEventSetsDone = flag; }
/** @return true if the viewer respond to the
QUIT_APPLICATION-event */
bool getQuitEventSetsDone() const { return _quitEventSetsDone; }

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay jean_seb-XzQKRVe1yT0V+D8aMU/***@public.gmane.org
http://whitestar02.dyndns-web.com/
michael kapelko
2012-08-05 05:39:24 UTC
Permalink
Thanks. ViewerBase::setKeyEventSetsDone(0) did help so that Viewer
doesn't listen to ESC, but now when I call ViewerBase::setDone(true)
myself, Viewer still fails to exit and prints:
Error: pthread_cond_destroy(,) returned error status, status = 16
after that, only Ctrl+C helps, because app hangs.

What is this and how do I fight it?
Thanks.

Loading...