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:
parent
ca6ce92d1e
commit
5181dc1427
1 changed files with 22 additions and 19 deletions
|
@ -133,29 +133,32 @@ BEGIN_METHOD_VOID(PdfDocument_free)
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (THIS->pages)
|
if (THIS->doc)
|
||||||
{
|
{
|
||||||
for (i = 0; i < poppler_document_get_n_pages(THIS->doc); i++)
|
if (THIS->pages)
|
||||||
{
|
{
|
||||||
if (THIS->pages[i])
|
for (i = 0; i < poppler_document_get_n_pages(THIS->doc); i++)
|
||||||
g_object_unref(THIS->pages[i]);
|
{
|
||||||
|
if (THIS->pages[i])
|
||||||
|
g_object_unref(THIS->pages[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
GB.Free(POINTER(&THIS->pages));
|
||||||
}
|
}
|
||||||
|
|
||||||
GB.Free(POINTER(&THIS->pages));
|
if (THIS->index)
|
||||||
|
{
|
||||||
|
for (i = 0; i < GB.Count(THIS->index); i++)
|
||||||
|
GB.Unref(POINTER(&THIS->index[i]));
|
||||||
|
|
||||||
|
GB.FreeArray(POINTER(&THIS->index));
|
||||||
|
}
|
||||||
|
|
||||||
|
delete THIS->renderer;
|
||||||
|
delete THIS->rdoc;
|
||||||
|
g_object_unref(THIS->doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (THIS->index)
|
|
||||||
{
|
|
||||||
for (i = 0; i < GB.Count(THIS->index); i++)
|
|
||||||
GB.Unref(POINTER(&THIS->index[i]));
|
|
||||||
|
|
||||||
GB.FreeArray(POINTER(&THIS->index));
|
|
||||||
}
|
|
||||||
|
|
||||||
delete THIS->renderer;
|
|
||||||
delete THIS->rdoc;
|
|
||||||
g_object_unref(THIS->doc);
|
|
||||||
|
|
||||||
GB.ReleaseFile(THIS->buffer, THIS->length);
|
GB.ReleaseFile(THIS->buffer, THIS->length);
|
||||||
|
|
||||||
END_METHOD
|
END_METHOD
|
||||||
|
|
Loading…
Reference in a new issue