[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kst/portto4/kst/src/libkstapp
From:       Peter Kümmel <syntheticpp () yahoo ! com>
Date:       2010-04-28 17:09:11
Message-ID: 20100428170911.12A01AC8A7 () svn ! kde ! org
[Download RAW message or body]

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 {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic