Details
-
Bug
-
Resolution: Incomplete
-
P1: Critical
-
None
-
5.7.0
-
None
-
Android 5/6 on LG G2 and Honor 6 Smartphone
Description
With the following code my Qt android app always crashes after a few (varing) minutes. The crash is reproducable and the reason is "dismissing emit signal() and value change together with Q_PROPERTY for Qml".
class MyClass : public QObject
{
Q_OBJECT
Q_PROPERTY(qreal value MEMBER m_value NOTIFY valueChanged)void myFunction() const;
}void myClass::myFunction() const {
....
// falsely dismissed the order, should be vice versa
qreal value = 5.0;
emit valueChanged(value);
m_value = value;
}
The myFunction is triggert from different sensorsfilters (e.g. QCompass, QRotation, QMagnetometer,...) and called around every 50msec. If I omit Q_PROPERTY/Qml no crash happens.
The message in the ouput window is
F/libc ( 3085): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x4070f3cc in tid 3346 (QtThread)
If I correctly implement "m_value = value;" and then "emit valueChanged(value);" everthing works fine. It seems so that if the emitting of the signal and few micro seconds later the value is changed and in the same time is passed to Qml a conflict occurs and brings the app to crash.