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 :
class CamWindow
: public QWidget,
private Ui
::CamWindow{
Q_OBJECT;
protected:
Xvideo *m_pXvPort;
public:
{
setupUi ( this );
Xvideo *m_pXvPort = NULL;
try
{
m_pXvPort = new Xvideo();
}
{
QMessageBox::warning ( this, tr
( "x video extension" ),
}
}
~CamWindow()
{
;
}
void setup()
{
m_pXvPort->setup ( winId(), 100, 100 );
}
};
class CamWindow : public QWidget, private Ui::CamWindow
{
Q_OBJECT;
protected:
Xvideo *m_pXvPort;
public:
CamWindow() : QWidget()
{
setupUi ( this );
Xvideo *m_pXvPort = NULL;
try
{
m_pXvPort = new Xvideo();
}
catch ( QString strErr )
{
QMessageBox::warning ( this, tr ( "x video extension" ),
strErr, QMessageBox::Ok );
}
}
~CamWindow()
{
;
}
void setup()
{
m_pXvPort->setup ( winId(), 100, 100 );
}
};
To copy to clipboard, switch view to plain text mode
called functions of class Xvideo:
Xvideo::Xvideo()
{
}
bool Xvideo::setup ( Drawable window, int width, int height )
{
// next command crashes
m_pDisplay = NULL;
....
}
Xvideo::Xvideo()
{
}
bool Xvideo::setup ( Drawable window, int width, int height )
{
// next command crashes
m_pDisplay = NULL;
....
}
To copy to clipboard, switch view to plain text mode
"main code":
CamWindow *w = new CamWindow();
m_pWorkspace->addWindow(w);
w->show();
w->setup();
CamWindow *w = new CamWindow();
m_pWorkspace->addWindow(w);
w->show();
w->setup();
To copy to clipboard, switch view to plain text mode
Bookmarks