12-03-2012 09:57 AM
12-03-2012 10:24 AM
The problem is not in DataServiceFormula::setFormula's implementation (I am 99% sure)
12-03-2012 10:30 AM
borceg wrote:
Try hard-coding this->formula = "whatever"; just for test. If that fails, something is wrong with the libs.
Good idea.
first attempt: pass a fixed string
dsFormula->setFormula("c1");
no change.
second attempt: change the setter (i renamed the parameter)
void DataServiceFormula::setFormula(QString aformula) {
formula = "c1";
//this->formula = formula;
}
no change, still a segfault.
When i comment out the whole function it runs:
void DataServiceFormula::setFormula(QString aformula) {
//formula = "c1";
//this->formula = formula;
}
Now i set a breakpoint in there, i get this:
Doesn't this mean the object is there?
But when i try to access it with qDebug() << "this: " << this; i get a segfault again.
12-03-2012 10:33 AM
What makes you think that 'the object is there'?
12-03-2012 10:35 AM
12-03-2012 10:37 AM
C does not check on pointers. When a variable is created there is no guarantee that it'll be initialized with zero. When an object is destroyed then there is no guarantee that poniter vairable that was pointing to this object will be 'nullled'
12-03-2012 10:43 AM
12-03-2012 10:46 AM
it might go out of visibility... it is impossible to help you without seeing more source code, that is why I asked for it -)
You can check on pointers.
12-03-2012 10:49 AM
12-03-2012 10:52 AM
In my opinion the issue is you are trying to access non existent object via pointer. It does not really matter whether this pointer = NULL or anything else.