summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2009-09-11 08:18:12 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2009-09-11 09:08:50 (GMT)
commit5a5337879fa4bfeacc1fe11e4b617ba623f22273 (patch)
tree8a997776b5df3161f5c41098b1a5f38bccff8f40 /src/gui/text
parent842ee1617923443ebb78d998ca3c5c8721442d91 (diff)
downloadQt-5a5337879fa4bfeacc1fe11e4b617ba623f22273.zip
Qt-5a5337879fa4bfeacc1fe11e4b617ba623f22273.tar.gz
Qt-5a5337879fa4bfeacc1fe11e4b617ba623f22273.tar.bz2
Clean up properly in the QPF1 font engine
We have to munmap() what we have mmap()ed Reviewed-by: Gunnar Reviewed-by: Jeremy
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_qws.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp
index 62a674a..888e1be 100644
--- a/src/gui/text/qfontengine_qws.cpp
+++ b/src/gui/text/qfontengine_qws.cpp
@@ -381,6 +381,8 @@ class QFontEngineQPF1Data
public:
QPFFontMetrics fm;
QPFGlyphTree *tree;
+ void *mmapStart;
+ size_t mmapLength;
};
@@ -410,6 +412,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QT_CLOSE(f);
d = new QFontEngineQPF1Data;
+ d->mmapStart = data;
+ d->mmapLength = st.st_size;
memcpy(reinterpret_cast<char*>(&d->fm),data,sizeof(d->fm));
data += sizeof(d->fm);
@@ -431,6 +435,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QFontEngineQPF1::~QFontEngineQPF1()
{
+ if (d->mmapStart)
+ munmap(d->mmapStart, d->mmapLength);
delete d->tree;
delete d;
}