Don't try to free unallocated things when releasing the PdfDocument object.

[GB.POPPLER]
* BUG: Don't try to free unallocated things when releasing the PdfDocument object.
This commit is contained in:
Benoît Minisini 2022-12-31 16:50:08 +01:00
parent ca6ce92d1e
commit 5181dc1427

View file

@ -133,6 +133,8 @@ BEGIN_METHOD_VOID(PdfDocument_free)
int i; int i;
if (THIS->doc)
{
if (THIS->pages) if (THIS->pages)
{ {
for (i = 0; i < poppler_document_get_n_pages(THIS->doc); i++) for (i = 0; i < poppler_document_get_n_pages(THIS->doc); i++)
@ -155,6 +157,7 @@ BEGIN_METHOD_VOID(PdfDocument_free)
delete THIS->renderer; delete THIS->renderer;
delete THIS->rdoc; delete THIS->rdoc;
g_object_unref(THIS->doc); g_object_unref(THIS->doc);
}
GB.ReleaseFile(THIS->buffer, THIS->length); GB.ReleaseFile(THIS->buffer, THIS->length);