summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-14 13:02:18 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-15 07:23:48 +1300
commitdb4ffd0b703b43f60b0802a21b434dd5b87f6be4 (patch)
treebf3741095b9ce4bb4860f78a6ef90b81a15d3da7 /qt-ui/profile/divetooltipitem.h
parent633dd64d2fa18b64fd13a593019a42316c1de775 (diff)
downloadsubsurface-db4ffd0b703b43f60b0802a21b434dd5b87f6be4.tar.gz
Fix memory leak
The QPainter and the QPixmap were being created but never freed. A QPixmap and a QPainter don't need to be created by new, they can be safely created on the stack. So, create them on the stack, pass them via const-reference and use them correctly. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.h')
-rw-r--r--qt-ui/profile/divetooltipitem.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h
index 51e8eccd1..bb3ad84d3 100644
--- a/qt-ui/profile/divetooltipitem.h
+++ b/qt-ui/profile/divetooltipitem.h
@@ -34,7 +34,7 @@ public:
void collapse();
void expand();
void clear();
- void addToolTip(const QString &toolTip, const QIcon &icon = QIcon(), const QPixmap *pixmap = NULL);
+ void addToolTip(const QString &toolTip, const QIcon &icon = QIcon(), const QPixmap &pixmap = QPixmap());
void refresh(const QPointF &pos);
bool isExpanded() const;
void persistPos();