1
0
mirror of https://gitlab.gnome.org/GNOME/evince synced 2024-07-02 15:48:59 +00:00

pdf: Fix dispose implementation

Dispose must be safe against multiple runs, so set pointers to NULL
after freeing them.
This commit is contained in:
Christian Persch 2021-12-07 18:53:11 +01:00 committed by Germán Poo-Caamaño
parent 4f7fc7443a
commit afd3383648

View File

@ -224,17 +224,9 @@ pdf_document_dispose (GObject *object)
pdf_document->annots = NULL;
}
if (pdf_document->document) {
g_object_unref (pdf_document->document);
}
if (pdf_document->font_info) {
poppler_font_info_free (pdf_document->font_info);
}
if (pdf_document->fonts_iter) {
poppler_fonts_iter_free (pdf_document->fonts_iter);
}
g_clear_object (&pdf_document->document);
g_clear_pointer (&pdf_document->font_info, poppler_font_info_free);
g_clear_pointer (&pdf_document->fonts_iter, poppler_fonts_iter_free);
G_OBJECT_CLASS (pdf_document_parent_class)->dispose (object);
}