]> rtime.felk.cvut.cz Git - orte.git/commit
SHAPE: Fix undefined behavior resulting in strange lock-ups
authorMartin Vajnar <Martin.Vajnar@cvut.cz>
Sun, 6 May 2018 10:49:46 +0000 (12:49 +0200)
committerMartin Vajnar <Martin.Vajnar@cvut.cz>
Sun, 6 May 2018 10:49:46 +0000 (12:49 +0200)
commiteb7337391fb3a8e7e2001393ba0642ef237ec400
tree167d3bfeba65e9643977a3a4fdfa21606a39fbb8
parent4979c1fc9237082342965d9074b0b1a1d23ba022
SHAPE: Fix undefined behavior resulting in strange lock-ups

This commit fixes intermittent freezes of 'subscriber' dialog. These
freezes were caused by invoking QWidget::update() directly from a non-GUI
thread. This is undefined behavior and leads to many strange lock-ups and
even SEGFAULTS.

In order to fix this we now introduce the signal changed(), that will be
emitted if repaint of shapes is requested either from publisher or
subscriber. This signal is connected to the update() slot. By default
signals are connected to slots by Qt::AutoConnection connection type. This
should ensure, that QT decides internally if it should treat this
connection as Qt::DirectConnection in case of publisher and
Qt::QueuedConnection in case of subscriber. This decision is made when the
signal is emitted.
orte/contrib/shape/MyQFrame.cpp
orte/contrib/shape/MyQFrame.h