diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-03-14 00:58:29 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-03-14 00:58:29 +0000 |
commit | c5ac32b538ff875cb979d4c436271acc426b66a8 (patch) | |
tree | 79b87ad62144c1180df8efd134aaaab19b3f3092 /fitz | |
parent | db55aef48ca9a4d00fa2c84965f86a779ce9dd88 (diff) | |
download | mupdf-c5ac32b538ff875cb979d4c436271acc426b66a8.tar.xz |
Free doc links without recursion
Taken from Sumatra.patch - Many thanks.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/doc_link.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fitz/doc_link.c b/fitz/doc_link.c index d558d18a..53fe4328 100644 --- a/fitz/doc_link.c +++ b/fitz/doc_link.c @@ -55,10 +55,11 @@ fz_keep_link(fz_context *ctx, fz_link *link) void fz_drop_link(fz_context *ctx, fz_link *link) { - if (link && --link->refs == 0) + while (link && --link->refs == 0) { - fz_drop_link(ctx, link->next); + fz_link *next = link->next; fz_free_link_dest(ctx, &link->dest); fz_free(ctx, link); + link = next; } } |