summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makerules7
-rw-r--r--scripts/cmapdump.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/Makerules b/Makerules
index 5b3d4fc1..013b2e20 100644
--- a/Makerules
+++ b/Makerules
@@ -9,11 +9,14 @@ CFLAGS += -Wall
ifeq "$(build)" "debug"
CFLAGS += -pipe -g -DDEBUG
+else ifeq "$(build)" "release"
+CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
+else ifeq "$(build)" "sanitize"
+CFLAGS += -pipe -g -DDEBUG -fsanitize=address -fno-omit-frame-pointer
+LDFLAGS += -fsanitize=address
else ifeq "$(build)" "profile"
CFLAGS += -pipe -O2 -DNDEBUG -pg
LDFLAGS += -pg
-else ifeq "$(build)" "release"
-CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer
else ifeq "$(build)" "coverage"
CFLAGS += -pipe -g -DDEBUG -pg -fprofile-arcs -ftest-coverage
LIBS += -lgcov
diff --git a/scripts/cmapdump.c b/scripts/cmapdump.c
index 06d8cbee..540fd946 100644
--- a/scripts/cmapdump.c
+++ b/scripts/cmapdump.c
@@ -179,6 +179,8 @@ main(int argc, char **argv)
if (getenv("verbose"))
printf("\t{\"%s\",&cmap_%s},\n", cmap->cmap_name, name);
+
+ pdf_drop_cmap(ctx, cmap);
}
if (fclose(fo))
@@ -232,12 +234,14 @@ void fz_copy_aa_context(fz_context *dst, fz_context *src)
void *fz_keep_storable(fz_context *ctx, const fz_storable *sc)
{
fz_storable *s = (fz_storable *)sc;
-
- return s;
+ return fz_keep_imp(ctx, s, &s->refs);
}
-void fz_drop_storable(fz_context *ctx, const fz_storable *s)
+void fz_drop_storable(fz_context *ctx, const fz_storable *sc)
{
+ fz_storable *s = (fz_storable *)sc;
+ if (fz_drop_imp(ctx, s, &s->refs))
+ s->drop(ctx, s);
}
void fz_new_store_context(fz_context *ctx, unsigned int max)