Fix LTMCanvasPicker SEGV on delete tab

.. not always, but sometimes !
This commit is contained in:
Mark Liversedge
2014-06-20 17:24:41 +01:00
parent c8614b1abb
commit 0be0f08afa
2 changed files with 5 additions and 4 deletions

View File

@@ -19,8 +19,7 @@ LTMCanvasPicker::LTMCanvasPicker(QwtPlot *plot):
d_selectedCurve(NULL),
d_selectedPoint(-1)
{
QwtPlotCanvas *canvas = static_cast<QwtPlotCanvas*>(plot->canvas());
canvas = static_cast<QwtPlotCanvas*>(plot->canvas());
canvas->installEventFilter(this);
@@ -41,8 +40,8 @@ bool LTMCanvasPicker::event(QEvent *e)
bool LTMCanvasPicker::eventFilter(QObject *object, QEvent *e)
{
if ( object != (QObject *)plot()->canvas() )
return false;
// for our canvas ?
if (object != canvas) return false;
switch(e->type())
{