PDA

View Full Version : QString exception while executing assignment operation



Giox79
20th February 2015, 22:44
Good morning,
I have a problem using QT 4.7.1 on a Wince Arm platform (pxa270).
I cross compiled some year ago the qt libraries, and I'm using them for the business logic section of my SW project.
I use the Qstring class in many sections of my code, but sometimes I get an exception at run time.

I found, for example, that this line of code

QString createdDateString= QDate::currentDate().toString();

Sometimes generates an exception.
If I modify my source code (also different section of the SW), the exception sometimes disappear.
Similar errors appear at run time when I use code initializations like that

QString a = "test"

Do you have any hint about this topic?
It seems a memory leak bug in my code, but I can't find where.
Best regards
Giovanni

anda_skoa
2nd March 2015, 12:30
In most cases when something like this happens, the object this code runs on, i.e. the object for which the surrounding method is called, is not valid (anymore).

Cheers,
_