[Kst] branches/work/kst/portto4/kst/src/libkstapp

Peter Kümmel syntheticpp at yahoo.com
Wed Apr 28 19:09:11 CEST 2010


SVN commit 1120228 by kuemmel:

fix memory leak

 M  +4 -4      legenditem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/legenditem.cpp #1120227:1120228
@@ -30,7 +30,7 @@
 namespace Kst {
 
 struct DrawnLegendItem {
-  QPixmap *pixmap;
+  QPixmap pixmap;
   QSize size;
 };
 
@@ -86,8 +86,8 @@
 
   foreach(RelationPtr relation, legendItems) {
     DrawnLegendItem item;
-    item.pixmap = new QPixmap(LEGENDITEMMAXWIDTH, LEGENDITEMMAXHEIGHT);
-    item.size = paintRelation(relation, item.pixmap, font);
+    item.pixmap = QPixmap(LEGENDITEMMAXWIDTH, LEGENDITEMMAXHEIGHT);
+    item.size = paintRelation(relation, &item.pixmap, font);
 
     if (_verticalDisplay) {
       legendSize.setWidth(qMax(legendSize.width(), item.size.width()));
@@ -141,7 +141,7 @@
   painter->drawRect(rect());
 
   foreach(DrawnLegendItem item, legendPixmaps) {
-    painter->drawPixmap(QPoint(x, y), *(item.pixmap), QRect(0, 0, item.size.width(), item.size.height()));
+    painter->drawPixmap(QPoint(x, y), item.pixmap, QRect(0, 0, item.size.width(), item.size.height()));
     if (_verticalDisplay) {
       y += item.size.height();
     } else {


More information about the Kst mailing list