summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-office/scribus/files/scribus-1.3.1-memleak.patch')
-rw-r--r--app-office/scribus/files/scribus-1.3.1-memleak.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/app-office/scribus/files/scribus-1.3.1-memleak.patch b/app-office/scribus/files/scribus-1.3.1-memleak.patch
new file mode 100644
index 000000000000..5e2528f6037a
--- /dev/null
+++ b/app-office/scribus/files/scribus-1.3.1-memleak.patch
@@ -0,0 +1,57 @@
+--- scribus-1.3.1-orig/scribus/util.cpp 2005-09-17 05:55:05.000000000 +0200
++++ scribus-1.3.1/scribus/util.cpp 2005-11-03 00:22:32.000000000 +0100
+@@ -1201,20 +1201,20 @@
+ {
+ static QMap<QRgb, QPixmap*> pxCache;
+
+- QPixmap * pm = pxCache[rgb.rgb()];
+- if (!pm)
+- {
+- pm = new QPixmap(15, 15);
+- pm->fill(rgb);
+- QPainter p;
+- p.begin(pm);
+- p.setBrush(Qt::NoBrush);
+- QPen b(Qt::black, 1);
+- p.setPen(b);
+- p.drawRect(0, 0, 15, 15);
+- p.end();
+- pxCache[rgb.rgb()] = pm;
+- }
++ QRgb index=rgb.rgb();
++ if (pxCache.contains(index))
++ return pxCache[index];
++
++ QPixmap *pm = new QPixmap(15, 15);
++ pm->fill(rgb);
++ QPainter p;
++ p.begin(pm);
++ p.setBrush(Qt::NoBrush);
++ QPen b(Qt::black, 1);
++ p.setPen(b);
++ p.drawRect(0, 0, 15, 15);
++ p.end();
++ pxCache.insert(index, pm);
+ return pm;
+ }
+
+@@ -1222,12 +1222,13 @@
+ {
+ static QMap<QRgb, QPixmap*> pxCache;
+
+- QPixmap * pm = pxCache[rgb.rgb()];
+- if (!pm) {
+- pm = new QPixmap(30, 15);
+- pm->fill(rgb);
+- pxCache[rgb.rgb()] = pm;
+- }
++ QRgb index=rgb.rgb();
++ if (pxCache.contains(index))
++ return pxCache[index];
++
++ QPixmap *pm = new QPixmap(30, 15);
++ pm->fill(rgb);
++ pxCache.insert(index, pm);
+ return pm;
+ }
+