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-14 08:12:58 (GMT)
commit2ffcf454806d0167c36bb626f07c3cc969206709 (patch)
tree718c5658c9441c9e2695897df7d6879f05e169a4 /src/gui/text
parentbd8f1171ea1d564bb9b8e04b1a220e5559d60423 (diff)
downloadQt-2ffcf454806d0167c36bb626f07c3cc969206709.zip
Qt-2ffcf454806d0167c36bb626f07c3cc969206709.tar.gz
Qt-2ffcf454806d0167c36bb626f07c3cc969206709.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 0c988e0..730fc2c 100644
--- a/src/gui/text/qfontengine_qws.cpp
+++ b/src/gui/text/qfontengine_qws.cpp
@@ -380,6 +380,8 @@ class QFontEngineQPF1Data
public:
QPFFontMetrics fm;
QPFGlyphTree *tree;
+ void *mmapStart;
+ size_t mmapLength;
};
@@ -409,6 +411,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
::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);
@@ -430,6 +434,8 @@ QFontEngineQPF1::QFontEngineQPF1(const QFontDef&, const QString &fn)
QFontEngineQPF1::~QFontEngineQPF1()
{
+ if (d->mmapStart)
+ munmap(d->mmapStart, d->mmapLength);
delete d->tree;
delete d;
}