Qwt trying to draw symbol even it is null
-
I am getting a strange null pointer for symbols after attaching a QwtPlotCurve to the plot. For some reason in line 409 the code goes on and tries to draw a symbol even symbol is 0x0 like you can see in the debugger.
History is that I have this compiled for 32bit and it has worked okay. Now I compiled qwt for 64bit and this problem has come up.
-
Hi and welcome to devnet,
Which version of Qwt are you using ?
With which version of Qt ?
On which OS ? -
@SGaist Thanks for the reply. I will try to do that.
I have multithreaded application where one thread pushes data to QwtSeriesStore. When I attach that data to plot the crash happens. I don't understand why qwt code goes so far.
JobData* gjr = JobData::instance(); gjr->curveData()->lock(); CustomQwtCurve* c = addCurve(); CurveData* cd = gjr->curveData(); c->setData(cd->getSeriesData()); c->attach(this);
JobData runs in one thread and of course UI is on another.
After this it crashes where the original screenshot is.
-
@phenoboy said in Qwt trying to draw symbol even it is null:
I have multithreaded application where one thread pushes data to QwtSeriesStore.
So this is the reason. You must modify the gui only from the main (gui) thread.
-
If you look at qwt oscilloscope example the curve data is updated in another thread than GUI.
I do the same. I update only the curve data and guard it with mutexes. In replot the data is locked. But I guess this must be the reason so I'll try to come up with a small compilable example to show the error.