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>
This commit is contained in:
Tomaz Canabrava 2015-01-14 13:02:18 -02:00 committed by Dirk Hohndel
parent 633dd64d2f
commit db4ffd0b70
2 changed files with 19 additions and 19 deletions

View file

@ -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();