The problem is as follows.

There is a program written with Qt 4.4.0. She worked for a long time, no problem.

I rebuilt it with Qt 4.8.1. OS Ubuntu 12.04.
Gathered fine.
But now there are strange falls.

Example:

void XEventButton::buttonPressed() { XEventButtonProperty* property = static_cast<XEventButtonProperty*> propertyItem->getProperty()); dlg->setupForExec( propertyItem->getValue(), property->getMode() ); dlg->exec(); propertyItem->setValue( dlg->getValue() ); } 

The dlg->getValue() occurs in the dlg->getValue() function. The dlg pointer suddenly became 0 .

If I put brekpoint in this place, then dlg already non-zero, then it falls in the same line, but because propertyItem = 0x20 (propertyItem is a pointer).

Changed the code to this:

 void XEventButton::buttonPressed() { XEventButtonProperty* property = static_cast<XEventButtonProperty*>(propertyItem->getProperty()); XEventButtonPropertyItem* tmp_prop_item = propertyItem; XEventDialog* tmp_dlg2 = dlg; dlg->setupForExec( propertyItem->getValue(), property->getMode() ); dlg->exec(); propertyItem = tmp_prop_item; dlg = tmp_dlg2; propertyItem->setValue( dlg->getValue() ); } 

and all The falls have stopped. What the heck? I do not understand what is going on.

There are some more incomprehensible things, but something tells me, the root of the problems is one.

  • And where is dlg declared? And where else does the work go with him? - ASten
  • @ASten, dlg is a member of the XEventButton class dialog box. dlg-> exec () - a dialog appears and waits for buttons to be pressed. I close the dialog, the dlg-> exec () function ends and dlg becomes equal to 0, before that it was not equal to 0. I assume that the problems are not in the code. Similar behavior can be observed if, for example, you connect a debugging library, for example, to a program assembled in a release. - dzukp
  • Returned to this task. I tried the same thing under Windows. Falls in the same place. - dzukp

0