summaryrefslogtreecommitdiff
path: root/poppler
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2006-05-13 16:01:57 +0000
committerAlbert Astals Cid <aacid@kde.org>2006-05-13 16:01:57 +0000
commit436f578fe762e8ceccce95a0f2003406527dde64 (patch)
tree4031e1a0cd30f1ea651976ac32436922a89bbb54 /poppler
parent906515769097f2e38f6b2c2aff598919b9d1ee0d (diff)
* poppler/GfxState.cc:
* poppler/GfxState.h: Fix memleak, patch by Carlos Garcia Campos <carlosgc@gnome.org>
Diffstat (limited to 'poppler')
-rw-r--r--poppler/GfxState.cc8
-rw-r--r--poppler/GfxState.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 9d54e1b4..75edae3e 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -4046,6 +4046,14 @@ void GfxState::setStrokePattern(GfxPattern *pattern) {
strokePattern = pattern;
}
+void GfxState::setFont(GfxFont *fontA, double fontSizeA) {
+ if (font)
+ font->decRefCnt();
+
+ font = fontA;
+ fontSize = fontSizeA;
+}
+
void GfxState::setLineDash(double *dash, int length, double start) {
if (lineDash)
gfree(lineDash);
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index 2f59dca0..4a436301 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -1127,8 +1127,7 @@ public:
void setLineJoin(int lineJoin1) { lineJoin = lineJoin1; }
void setLineCap(int lineCap1) { lineCap = lineCap1; }
void setMiterLimit(double limit) { miterLimit = limit; }
- void setFont(GfxFont *fontA, double fontSizeA)
- { font = fontA; fontSize = fontSizeA; }
+ void setFont(GfxFont *fontA, double fontSizeA);
void setTextMat(double a, double b, double c,
double d, double e, double f)
{ textMat[0] = a; textMat[1] = b; textMat[2] = c;