diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 04b49ed6..36ae40ca 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -658,7 +658,6 @@ void UBApplicationController::closing() if (mUninoteController) { - mUninoteController->hideWindow(); mUninoteController->close(); } diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 280acfea..d5de377b 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -67,6 +67,7 @@ UBPersistenceManager * UBPersistenceManager::sSingleton = 0; UBPersistenceManager::UBPersistenceManager(QObject *pParent) : QObject(pParent) , mHasPurgedDocuments(false) + , mIsApplicationClosing(false) , mIsWorkerFinished(false) { @@ -131,8 +132,10 @@ void UBPersistenceManager::destroy() void UBPersistenceManager::onScenePersisted(UBGraphicsScene* scene) { - delete scene; - scene = NULL; + if (!mIsApplicationClosing) { + delete scene; + scene = NULL; + } } void UBPersistenceManager::onMetadataPersisted(UBDocumentProxy* proxy) @@ -147,6 +150,8 @@ void UBPersistenceManager::onWorkerFinished() UBPersistenceManager::~UBPersistenceManager() { + mIsApplicationClosing = true; + if(mWorker) mWorker->applicationWillClose(); @@ -943,7 +948,6 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy) empty = theSoleScene->isEmpty(); if(empty){ mSceneCache.removeScene(pDocumentProxy,0); - delete theSoleScene; theSoleScene = NULL; } else{ @@ -960,7 +964,6 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy) } if(!usefulItemFound){ mSceneCache.removeScene(pDocumentProxy,0); - delete theSoleScene; theSoleScene = NULL; empty = true; } diff --git a/src/core/UBPersistenceManager.h b/src/core/UBPersistenceManager.h index 08556061..19d10f66 100644 --- a/src/core/UBPersistenceManager.h +++ b/src/core/UBPersistenceManager.h @@ -157,6 +157,8 @@ class UBPersistenceManager : public QObject QThread* mThread; bool mIsWorkerFinished; + bool mIsApplicationClosing; + private slots: void documentRepositoryChanged(const QString& path); void errorString(QString error); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 3544d464..f17911be 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -354,7 +354,10 @@ void UBDesktopAnnotationController::showWindow() void UBDesktopAnnotationController::close() { - // NOOP + if (mTransparentDrawingView) + mTransparentDrawingView->hide(); + + mDesktopPalette->hide(); }