diff options
author | Paul Gardiner <paul.gardiner@artifex.com> | 2018-08-08 16:40:17 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-08-21 13:14:58 +0200 |
commit | f2c6b77550898e52d594637b9395f9b001c6be7a (patch) | |
tree | 5881b5f347cabab4166b902dcf5701eb155b729a /source/pdf | |
parent | 1a4fc8250f89e316c0a8cdb71fa47dd591255176 (diff) | |
download | mupdf-f2c6b77550898e52d594637b9395f9b001c6be7a.tar.xz |
Avoid unnecessary NULLing of doc->focus
doc->focus refers to a widget record within a specific page. We shouldn't
NULL it when dropping a different page.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-page.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index 7f9a00e3..ba080340 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -882,15 +882,14 @@ pdf_drop_page_imp(fz_context *ctx, pdf_page *page) { pdf_document *doc = page->doc; + /* We are about to destroy the annotation records for this page and so, + * if doc->focus refers to one of them, it must be NULLed */ + if (doc->focus && doc->focus->page == page) + doc->focus = NULL; + fz_drop_link(ctx, page->links); pdf_drop_annots(ctx, page->annots); - /* doc->focus, when not NULL, refers to one of - * the annotations and must be NULLed when the - * annotations are destroyed. doc->focus_obj - * keeps track of the actual annotation object. */ - doc->focus = NULL; - pdf_drop_obj(ctx, page->obj); fz_drop_document(ctx, &page->doc->super); |