pure virtual Runtime Error in qwt_plot_curve.cpp
Hi guys, I'm using 4.7.0 and qwt 6.0.1 with vs 2008 (note problem also happens on vs 2010 or with qwt 6.0.0). I'm basically drawing a sine graph with my own class that extends qwtplot. Theres a producer class creating the sine data in its own thread and the gui thread renders it at a set replot() rate. After a few arbritrary seconds (not at the same time on each run) vs aborts with:
R6025 -pure virtual function call
with the call stack always breaking out at
double x = xMap.transform( sample.x() );
in qwt_plot_curve.cpp (line 397)
I have no idea whats going on. Any ideas?
Re: pure virtual Runtime Error in qwt_plot_curve.cpp
How do you set the data on the curve?
Is the data you set available during the life of the curve object?
My guess would be that you're discarding the data while curve want's to access it.
From documentation:
Quote:
Initialize the data by pointing to memory blocks which are not managed by QwtPlotCurve.
setRawSamples is provided for efficiency. It is important to keep the pointers during the lifetime of the underlying QwtCPointerData class.
Re: pure virtual Runtime Error in qwt_plot_curve.cpp
I've solved this. The data was not being discarded and was correctly accessed using boost mutexes (the producer thread is a boost thread). I was able to resolve the issue by using the boost thread to trigger qt events rather than running qt code on a boost thread. It appears that in some cases boost threads and qt threads don't play nice together.