Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
422ab4c5
Commit
422ab4c5
authored
Mar 27, 2014
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scene are deleted on gui thread
parent
55a4b860
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
2 deletions
+12
-2
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+7
-0
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+1
-0
UBPersistenceWorker.cpp
src/core/UBPersistenceWorker.cpp
+3
-2
UBPersistenceWorker.h
src/core/UBPersistenceWorker.h
+1
-0
No files found.
src/core/UBPersistenceManager.cpp
View file @
422ab4c5
...
...
@@ -86,6 +86,7 @@ UBPersistenceManager::UBPersistenceManager(QObject *pParent)
connect
(
mWorker
,
SIGNAL
(
finished
()),
mWorker
,
SLOT
(
deleteLater
()));
connect
(
mThread
,
SIGNAL
(
finished
()),
mThread
,
SLOT
(
deleteLater
()));
connect
(
mWorker
,
SIGNAL
(
sceneLoaded
(
QByteArray
,
UBDocumentProxy
*
,
int
)),
this
,
SLOT
(
onSceneLoaded
(
QByteArray
,
UBDocumentProxy
*
,
int
)));
connect
(
mWorker
,
SIGNAL
(
scenePersisted
(
UBGraphicsScene
*
)),
this
,
SLOT
(
onScenePersisted
(
UBGraphicsScene
*
)));
mThread
->
start
();
}
...
...
@@ -107,6 +108,12 @@ void UBPersistenceManager::destroy()
sSingleton
=
NULL
;
}
void
UBPersistenceManager
::
onScenePersisted
(
UBGraphicsScene
*
scene
)
{
delete
scene
;
scene
=
NULL
;
}
void
UBPersistenceManager
::
onWorkerFinished
()
{
mIsWorkerFinished
=
true
;
...
...
src/core/UBPersistenceManager.h
View file @
422ab4c5
...
...
@@ -160,6 +160,7 @@ class UBPersistenceManager : public QObject
void
errorString
(
QString
error
);
void
onSceneLoaded
(
QByteArray
,
UBDocumentProxy
*
,
int
);
void
onWorkerFinished
();
void
onScenePersisted
(
UBGraphicsScene
*
scene
);
};
...
...
src/core/UBPersistenceWorker.cpp
View file @
422ab4c5
...
...
@@ -63,8 +63,9 @@ void UBPersistenceWorker::process()
PersistenceInformation
info
=
saves
.
takeFirst
();
if
(
info
.
action
==
WriteScene
){
UBSvgSubsetAdaptor
::
persistScene
(
info
.
proxy
,
info
.
scene
,
info
.
sceneIndex
);
delete
info
.
scene
;
info
.
scene
=
NULL
;
// delete info.scene;
// info.scene = NULL;
emit
scenePersisted
(
info
.
scene
);
}
else
{
emit
sceneLoaded
(
UBSvgSubsetAdaptor
::
loadSceneAsText
(
info
.
proxy
,
info
.
sceneIndex
),
info
.
proxy
,
info
.
sceneIndex
);
...
...
src/core/UBPersistenceWorker.h
View file @
422ab4c5
...
...
@@ -55,6 +55,7 @@ signals:
void
finished
();
void
error
(
QString
string
);
void
sceneLoaded
(
QByteArray
text
,
UBDocumentProxy
*
proxy
,
const
int
pageIndex
);
void
scenePersisted
(
UBGraphicsScene
*
scene
);
public
slots
:
void
process
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment