P
P
Perzh2014-08-14 09:40:42
Qt
Perzh, 2014-08-14 09:40:42

Why doesn't the signal work in Release mode?

Hello.
Faced such a problem: the feature works in the Debug version, but not in the Release version. Started debugging the Release version using logs. I found out that the desired method does not start at all, although it should have. This method is a slot, i.e. triggered by an update signal of some object. The connection seems to work fine (it costs Q_ASSERT(connect(...))). Please tell me what could be wrong?
PS: IDE = MS Visual Studio 2008
PPS: Connected another slot to this signal, it doesn't work either. That is, it seems to me that the signal is simply not generated.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bogolt, 2014-08-14
@Perzh

> The connection seems to be running normally (it's worth asserting)
I suspect that you wrote something like this
and this is your mistake.
The fact is that in the release assembly, all assertions from the code are thrown out. There is a define, which says that asserts display an error message in debug, and change to void in release. And since the assert was thrown out, your function was also thrown out.
So check the result of functions not in asserts, or first get the value of the function and then shove it into the assert.

L
lAtrey, 2014-08-14
@lAtrey

Release is just not good for debugging. With Release, the compiler optimizes the code, and therefore, for example, when stepping debugging from the current line, you can jump ten lines below, and so on. So the feature works, but you can't debug it that way. Work in Debug.
ps: this information is for MSVS, but I believe there is something similar in qt.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question