Re: [Interest] QObject connect/disconnect bug?

2019-01-17 Thread Alexander Dyagilev

Sorry, it's seems there is some "nice" bug in my app...

On 1/18/2019 10:13 AM, Alexander Dyagilev wrote:

Hello,

I have one object (A) in one thread sometimes connecting to another 
object (B) in another thread.


Object A connects its slots to B's signals. Once a slot is called, it 
disconnects it from the appropriate signal.


But, I have a problem now that sometimes the connection seems to 
disappear nowhere. Looks like a race condition bug, because it's not 
100% reproducible and is not reproducible in the debug builds at all. 
Only in release.


I.e. slot is NOT called when the signal is emitted.

I've added logging to file. I've overridden QObject's connectNotify 
and disconnectNotify methods. In the log I see that the connectNotify 
is called for signal (and the appropriate disconnectNotify is never 
called). In the code where I emit signal I've added the additional 
check: QObject::isSignalConnected returns 0 for signal. Thus emit does 
not call the slot. But connectNotify was called and disconnectNotify 
was NOT. Which means the connection must exist!


Any help? What is going on?

Qt 5.11.3, Windows 10, Visual C++ 2015.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QObject connect/disconnect bug?

2019-01-17 Thread Alexander Dyagilev

A and B objects are not single instance objects.

I have several A objects working with several B objects.

Some of objects works fine. Some - experience this bug.

I'm sure that there is no conflict between different instances of these 
objects.



On 1/18/2019 10:13 AM, Alexander Dyagilev wrote:

Hello,

I have one object (A) in one thread sometimes connecting to another 
object (B) in another thread.


Object A connects its slots to B's signals. Once a slot is called, it 
disconnects it from the appropriate signal.


But, I have a problem now that sometimes the connection seems to 
disappear nowhere. Looks like a race condition bug, because it's not 
100% reproducible and is not reproducible in the debug builds at all. 
Only in release.


I.e. slot is NOT called when the signal is emitted.

I've added logging to file. I've overridden QObject's connectNotify 
and disconnectNotify methods. In the log I see that the connectNotify 
is called for signal (and the appropriate disconnectNotify is never 
called). In the code where I emit signal I've added the additional 
check: QObject::isSignalConnected returns 0 for signal. Thus emit does 
not call the slot. But connectNotify was called and disconnectNotify 
was NOT. Which means the connection must exist!


Any help? What is going on?

Qt 5.11.3, Windows 10, Visual C++ 2015.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest