I made further tests. I'm able to crash the program without any Xlib calls at all:

I found out, that writing a simple member variable in (my class) Xvideo break things when its not inside the constructor ...?
I commented out the whole constructor code of Xvideo. I placed
>m_pDisplay = NULL;
as first command in setup(), which is enough to let it crash.

No I've even less ideas.... looks a bit like "we called the function of a deleted object"

relevant code:

class CamWindow :
Qt Code:
  1. class CamWindow : public QWidget, private Ui::CamWindow
  2. {
  3. Q_OBJECT;
  4. protected:
  5. Xvideo *m_pXvPort;
  6. public:
  7. CamWindow() : QWidget()
  8. {
  9. setupUi ( this );
  10. Xvideo *m_pXvPort = NULL;
  11. try
  12. {
  13. m_pXvPort = new Xvideo();
  14. }
  15. catch ( QString strErr )
  16. {
  17. QMessageBox::warning ( this, tr ( "x video extension" ),
  18. strErr, QMessageBox::Ok );
  19. }
  20.  
  21. }
  22. ~CamWindow()
  23. {
  24. ;
  25. }
  26. void setup()
  27. {
  28. m_pXvPort->setup ( winId(), 100, 100 );
  29. }
  30. };
To copy to clipboard, switch view to plain text mode 

called functions of class Xvideo:
Qt Code:
  1. Xvideo::Xvideo()
  2. {
  3.  
  4. }
  5.  
  6. bool Xvideo::setup ( Drawable window, int width, int height )
  7. {
  8. // next command crashes
  9. m_pDisplay = NULL;
  10. ....
  11.  
  12.  
  13. }
To copy to clipboard, switch view to plain text mode 

"main code":
Qt Code:
  1. CamWindow *w = new CamWindow();
  2. m_pWorkspace->addWindow(w);
  3. w->show();
  4. w->setup();
To copy to clipboard, switch view to plain text mode