summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-08-26 20:32:59 +0000
committerEric Anholt <anholt@freebsd.org>2004-08-26 20:32:59 +0000
commit5335bc8a0657b3e378795b44698ed23020c13891 (patch)
treef1eb3f23cffa7d7e668f4bcc836be022b845775f
parentc8672e7ac79c872344f287f7cc106cb5c006e619 (diff)
Bug #1138: Wrap funcs in CW's GC ops as well. While this is unnecessary
according to the rules as I understand them (bug #1045), not everybody follows the rules. GC funcs were being called on the same GC from within GC ops, and the cwValidateGC caused a loop in the funcs chain that resulted in a crash, notably in cwPolylines.
-rw-r--r--miext/cw/cw.c2
-rw-r--r--miext/cw/cw_ops.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 4f9b38aa6..5b45075d8 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -65,7 +65,7 @@ cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
static void
cwDestroyClip(GCPtr pGC);
-static GCFuncs cwGCFuncs = {
+GCFuncs cwGCFuncs = {
cwValidateGC,
cwChangeGC,
cwCopyGC,
diff --git a/miext/cw/cw_ops.c b/miext/cw/cw_ops.c
index 198337cf8..f4d6e3478 100644
--- a/miext/cw/cw_ops.c
+++ b/miext/cw/cw_ops.c
@@ -37,14 +37,19 @@
&src_off_y)
#define PROLOGUE(pGC) do { \
+ pGC->funcs = pGCPrivate->wrapFuncs;\
pGC->ops = pGCPrivate->wrapOps;\
} while (0)
#define EPILOGUE(pGC) do { \
+ pGCPrivate->wrapFuncs = (pGC)->funcs; \
pGCPrivate->wrapOps = (pGC)->ops; \
+ (pGC)->funcs = &cwGCFuncs; \
(pGC)->ops = &cwGCOps; \
} while (0)
+extern GCFuncs cwGCFuncs;
+
/*
* GC ops -- wrap each GC operation with our own function
*/