From 2a25c777388cadc86b6c696c9262c875cf7c23e6 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Fri, 9 Dec 2016 10:15:29 +0100 Subject: [PATCH] utils.c: also call fz_close_device() before dropping it After mupdf-1.10 API update fz_close_device() needed to be called otherwise search (`/' and `?' commands) no longer works and warns out via `warning: dropping unclosed device'. Calling fz_close_device() before fz_drop_device() fixes this regression. --- utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/utils.c b/utils.c index 648187a..5605783 100644 --- a/utils.c +++ b/utils.c @@ -23,6 +23,7 @@ mupdf_page_extract_text(mupdf_document_t* mupdf_document, mupdf_page_t* mupdf_pa fz_scale(&ctm, 1.0, 1.0); fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, &ctm, NULL); } fz_always (mupdf_document->ctx) { + fz_close_device(mupdf_page->ctx, text_device); fz_drop_device(mupdf_page->ctx, text_device); } fz_catch(mupdf_document->ctx) { } -- 2.11.0