Commit 5cea797e authored by Claudio Valerio's avatar Claudio Valerio

Scene is copied before being queued to avoid concurrence

parent bea07404
...@@ -738,7 +738,11 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, ...@@ -738,7 +738,11 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
if (pScene->isModified()) if (pScene->isModified())
{ {
UBThumbnailAdaptor::persistScene(pDocumentProxy, pScene, pSceneIndex); UBThumbnailAdaptor::persistScene(pDocumentProxy, pScene, pSceneIndex);
mWorker->saveScene(pDocumentProxy, pScene, pSceneIndex); QTime time;
time.start();
UBGraphicsScene* copiedScene = pScene->sceneDeepCopy();
qDebug() << "time to duplicate scene " << time.elapsed() << " ms";
mWorker->saveScene(pDocumentProxy, copiedScene, pSceneIndex);
pScene->setModified(false); pScene->setModified(false);
} }
......
...@@ -57,8 +57,11 @@ void UBPersistenceWorker::process() ...@@ -57,8 +57,11 @@ void UBPersistenceWorker::process()
mSemaphore.acquire(); mSemaphore.acquire();
do{ do{
PersistenceInformation info = saves.takeFirst(); PersistenceInformation info = saves.takeFirst();
if(info.action == WriteScene) if(info.action == WriteScene){
UBSvgSubsetAdaptor::persistScene(info.proxy, info.scene, info.sceneIndex); UBSvgSubsetAdaptor::persistScene(info.proxy, info.scene, info.sceneIndex);
delete info.scene;
info.scene = NULL;
}
else{ else{
emit sceneLoaded(UBSvgSubsetAdaptor::loadSceneAsText(info.proxy,info.sceneIndex), info.proxy, info.sceneIndex); emit sceneLoaded(UBSvgSubsetAdaptor::loadSceneAsText(info.proxy,info.sceneIndex), info.proxy, info.sceneIndex);
} }
......
...@@ -665,14 +665,6 @@ void UBGraphicsScene::DisposeMagnifierQWidgets() ...@@ -665,14 +665,6 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferControlViewWidget = NULL; magniferControlViewWidget = NULL;
} }
if(magniferDisplayViewWidget)
{
magniferDisplayViewWidget->hide();
magniferDisplayViewWidget->setParent(0);
delete magniferDisplayViewWidget;
magniferDisplayViewWidget = NULL;
}
// some time have crash here on access to app (when call from destructor when close OpenBoard app) // some time have crash here on access to app (when call from destructor when close OpenBoard app)
// so i just add try/catch section here // so i just add try/catch section here
try try
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment