From 5a5337879fa4bfeacc1fe11e4b617ba623f22273 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 11 Sep 2009 10:18:12 +0200 Subject: Clean up properly in the QPF1 font engine We have to munmap() what we have mmap()ed Reviewed-by: Gunnar Reviewed-by: Jeremy --- src/gui/text/qfontengine_qws.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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(&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; } -- cgit v0.12