https://bugs.kde.org/show_bug.cgi?id=447363
--- Comment #5 from Nate Graham <n...@kde.org> --- Nope, that doesn't fix it, assuming I did it right: diff --git core/document.cpp core/document.cpp index b6be827f1..9a80db24f 100644 --- core/document.cpp +++ core/document.cpp @@ -2486,10 +2486,12 @@ KXMLGUIClient *Document::guiClient() void Document::closeDocument() { - // check if there's anything to close... - if (!d->m_generator) + // check if there's anything to close or if we are already closing... + if (!d->m_generator || d->m_isClosing) return; + d->m_isClosing = true; + emit aboutToClose(); delete d->m_pageController; @@ -2639,6 +2641,7 @@ void Document::closeDocument() // see: https://sourceware.org/bugzilla/show_bug.cgi?id=14827 malloc_trim(0); #endif + d->m_isClosing = false; } void Document::addObserver(DocumentObserver *pObserver) diff --git core/document_p.h core/document_p.h index bd932db37..c8c93c47a 100644 --- core/document_p.h +++ core/document_p.h @@ -129,6 +129,7 @@ public: , m_annotationBeingModified(false) , m_docdataMigrationNeeded(false) , m_synctex_scanner(nullptr) + , m_isClosing(false) { calculateMaxTextPages(); } @@ -345,6 +346,8 @@ public: static QVector<KPluginMetaData> availableGenerators(); static QVector<KPluginMetaData> configurableGenerators(); static KPluginMetaData generatorForMimeType(const QMimeType &type, QWidget *widget, const QVector<KPluginMetaData> &triedOffers = QVector<KPluginMetaData>()); + + bool m_isClosing; }; class DocumentInfoPrivate -- You are receiving this mail because: You are watching all bug changes.