Hi! I'am sorry to my english.
Why code line
delete dbe;
delete dbe;
To copy to clipboard, switch view to plain text mode
cause for Segmentatuon fault, if this line to follow after code
DBEvent* dbe = new DBEvent(n,x,y);
...
msleep(1);
//delete dbe;
DBEvent* dbe = new DBEvent(n,x,y);
QApplication::postEvent( receiver, dbe );
...
msleep(1);
//delete dbe;
To copy to clipboard, switch view to plain text mode
Аbove code from within QThread::run().
The class DBEven implementation:
class DBEvent : public QCustomEvent {
public:
DBEvent( int n_, double* px_, double* py_) :
QCustomEvent( 65432 ), n(n_), px(px_), py(py_) {
}
...
private:
int n;
double *px;
double *py;
};
class DBEvent : public QCustomEvent {
public:
DBEvent( int n_, double* px_, double* py_) :
QCustomEvent( 65432 ), n(n_), px(px_), py(py_) {
}
...
private:
int n;
double *px;
double *py;
};
To copy to clipboard, switch view to plain text mode
Who killed CustomEvent?
Thanks.
Bookmarks