Fix crash after opening document

This commit is contained in:
Jakub Melka 2019-12-09 19:24:27 +01:00
parent 7bcbd512a8
commit 1b7fba2f78
1 changed files with 2 additions and 0 deletions

View File

@ -731,6 +731,7 @@ void PDFThumbnailsItemModel::setDocument(const PDFDocument* document)
{
if (m_document != document)
{
beginResetModel();
m_thumbnailCache.clear();
m_document = document;
@ -739,6 +740,7 @@ void PDFThumbnailsItemModel::setDocument(const PDFDocument* document)
{
m_pageCount = static_cast<int>(m_document->getCatalog()->getPageCount());
}
endResetModel();
}
}