|
From: cpascual <cpa...@ce...> - 2015-07-10 12:51:57
|
TaurusPlot defines a set of pens to use by default. They are set
with width=2. It has been found that using width=2 causes a
memory leak on replotting. Change the width to 1 to avoid
triggering this mem leak. Note that this is just a workaround for
the *default* pens. The leak will still appear if the pen is
customised (e.g. by the user)
---
lib/taurus/qt/qtgui/plot/taurusplot.py | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lib/taurus/qt/qtgui/plot/taurusplot.py b/lib/taurus/qt/qtgui/plot/taurusplot.py
index e931c18..b0824e8 100644
--- a/lib/taurus/qt/qtgui/plot/taurusplot.py
+++ b/lib/taurus/qt/qtgui/plot/taurusplot.py
@@ -67,13 +67,16 @@ class DummyLock(object):
#from taurus.core.util.log import TraceIt, DebugIt, InfoIt, WarnIt
-DFT_CURVE_PENS = [Qt.QPen(Qt.Qt.red, 2),
- Qt.QPen(Qt.Qt.blue, 2),
- Qt.QPen(Qt.Qt.green, 2),
- Qt.QPen(Qt.Qt.magenta, 2),
- Qt.QPen(Qt.Qt.cyan, 2),
- Qt.QPen(Qt.Qt.yellow, 2),
- Qt.QPen(Qt.Qt.black, 2)]
+DFT_CURVE_PENS = [Qt.QPen(Qt.Qt.red),
+ Qt.QPen(Qt.Qt.blue),
+ Qt.QPen(Qt.Qt.green),
+ Qt.QPen(Qt.Qt.magenta),
+ Qt.QPen(Qt.Qt.cyan),
+ Qt.QPen(Qt.Qt.yellow),
+ Qt.QPen(Qt.Qt.black)]
+
+for __p in DFT_CURVE_PENS:
+ __p.setWidth(1) # TODO: we would like this to be 2, but bug #171 forces 1
class TaurusZoomer(Qwt5.QwtPlotZoomer):
'''A QwtPlotZoomer that displays the label assuming that X values are timestamps'''
--
2.1.4
|