git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed logging bug in giflib detection
[swftools.git]
/
pdf2swf
/
xpdf
/
CMap.cc
diff --git
a/pdf2swf/xpdf/CMap.cc
b/pdf2swf/xpdf/CMap.cc
index
b49cffd
..
25f3af7
100644
(file)
--- a/
pdf2swf/xpdf/CMap.cc
+++ b/
pdf2swf/xpdf/CMap.cc
@@
-2,15
+2,16
@@
//
// CMap.cc
//
//
// CMap.cc
//
-// Copyright 2001-2002 Glyph & Cog, LLC
+// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
//
//========================================================================
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#pragma implementation
#endif
-#include <aconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-143,6
+144,9
@@
CMap::CMap(GString *collectionA, GString *cMapNameA) {
vector[i].cid = 0;
}
refCnt = 1;
vector[i].cid = 0;
}
refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
}
CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
}
CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
@@
-151,6
+155,9
@@
CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
wMode = wModeA;
vector = NULL;
refCnt = 1;
wMode = wModeA;
vector = NULL;
refCnt = 1;
+#if MULTITHREADED
+ gInitMutex(&mutex);
+#endif
}
void CMap::useCMap(CMapCache *cache, char *useName) {
}
void CMap::useCMap(CMapCache *cache, char *useName) {
@@
-251,6
+258,9
@@
CMap::~CMap() {
if (vector) {
freeCMapVector(vector);
}
if (vector) {
freeCMapVector(vector);
}
+#if MULTITHREADED
+ gDestroyMutex(&mutex);
+#endif
}
void CMap::freeCMapVector(CMapVectorEntry *vec) {
}
void CMap::freeCMapVector(CMapVectorEntry *vec) {
@@
-265,11
+275,26
@@
void CMap::freeCMapVector(CMapVectorEntry *vec) {
}
void CMap::incRefCnt() {
}
void CMap::incRefCnt() {
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
++refCnt;
++refCnt;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
}
void CMap::decRefCnt() {
}
void CMap::decRefCnt() {
- if (--refCnt == 0) {
+ GBool done;
+
+#if MULTITHREADED
+ gLockMutex(&mutex);
+#endif
+ done = --refCnt == 0;
+#if MULTITHREADED
+ gUnlockMutex(&mutex);
+#endif
+ if (done) {
delete this;
}
}
delete this;
}
}