Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 71966 Details for
Bug 111300
Memory leak in Scribus 1.3.1 colour pixmap cache
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Memory leak fix backport from 1.3.2cvs
scribus-bug-2787-memory-leak-fix.patch (text/plain), 1.12 KB, created by
Craig Bradney
on 2005-11-02 15:24:04 UTC
(
hide
)
Description:
Memory leak fix backport from 1.3.2cvs
Filename:
MIME Type:
Creator:
Craig Bradney
Created:
2005-11-02 15:24:04 UTC
Size:
1.12 KB
patch
obsolete
>--- util.cpp 2005-09-17 05:55:05.000000000 +0200 >+++ utilmemleakfixed.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; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 111300
: 71966