-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/: cope with use of
explicit
in MuPDF C++ API.
This will automatically cope with a future change to the MuPDF C++ bindings. The C++ bindings will use `explicit` on constructors of wrapper classes that take a pointer to the underlying wrapped C struct. This will avoids incorrect behaviour where the destructor will drop without a prior keep - we get a build error instead of a runtime segv. The fix in PyMuPDF is to have src/extra.i use a new macro PDF_NAME2() which returns a mupdf::PdfObj instead of a pdf_obj*. No fix is required in Python code because SWIG seems to ignore `explicit` and generates code that explicitly calls the appropriate constructor if (for example) Python code passes a pdf_obj* to a function requiring a PdfObj.
- Loading branch information
1 parent
66e5b1e
commit 62c87cc
Showing
2 changed files
with
47 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters