From 0f5069784da9dd89c7c2d2b2a2de52d3f653d91c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 23 Jan 2014 16:07:22 -0200 Subject: Prevent memory leak by removing the texts on the TemperatureItem This patch prevents memory leak by adding the text on the list of 'delete me when model changes' items. it also makes things a bit more snappy because the scene doesn't have to deal with all of the texts bounding rectangles eveytime. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveprofileitem.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 774938c95..42c3ecaea 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -249,6 +249,7 @@ void DiveTemperatureItem::createTextItem(int sec, int mkelvin) text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin))); text->setText(QString("%1%2").arg(deg, 0, 'f', 1).arg(unit)); // text->setSize(TEMP_TEXT_SIZE); //TODO: TEXT SIZE! + texts.append(text); } void DiveTemperatureItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) -- cgit v1.2.3-70-g09d2