PDA

View Full Version : QWidget::update crash in another thread



waiter
20th March 2013, 02:16
0 QRegion::isEmpty() const /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4d3cc25
1 ?? /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4dc8420
2 QWidget::update(QRect const&) /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib/libQtGui.so.4 0 0x7ffff4bd6f82
3 QWidget::update qwidget.h 1000 0x459809
4 WndMain::SlaveCallback WndMain.cpp 3375 0x4497be
5 DirectFeedback::OnVideoPreviewFrame DirectOperator.cpp 25 0x7fffe29c7750
6 CameraAgent::OnReceivePreviewVideo CameraAgent.cpp 159 0x7fffe294f124
7 VideoConsumer::Receive CameraAgent.h 70 0x7fffe294f71f
8 Multiplexer::Deliver Multiplexer.cpp 506 0x7fffe29ae456
9 Deliverer::operator() Multiplexer.cpp 673 0x7fffe29af793
10 GrThread::GrThread<Deliverer>(Deliverer&, void*)::A::Run() grthread.hpp 294 0x7fffe29b7d16
11 GrThread::GrThread<Deliverer>(Deliverer&, void*)::A::proc(void*) grthread.hpp 298 0x7fffe29b5a7d
12 start_thread /lib64/libpthread.so.0 0 0x7ffff3f66f05
13 clone /lib64/libc.so.6 0 0x7ffff353253d

anda_skoa
20th March 2013, 20:12
Looks like you are calling a QWidget method from a thread that is not the thread running QApplication::exec() (also often referred to as the main thread).

Fixing that should make then problem go away as well.

Cheers,
_

waiter
21st March 2013, 11:55
but I find QWidget::udpate just like
QApplication::postEvent(frame, new UpdateVideoEvent(QRect(0,0,10,10)));

UpdateVideoEvent is QEvent(UpdateLater)

it just crash in QRegion::isEmpty(),

anda_skoa
22nd March 2013, 16:54
Hmm. What if you invoke the update method like this


QMetaObject::invokeMethod(frame, "update", Qt::QueuedConnection);


Cheers,
_