Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
FreeCAD
FreeCAD
Commits
da2d3644
Commit
da2d3644
authored
Jul 17, 2017
by
wmayer
Browse files
protect document against nested recomputes
parent
7a0bc376
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/App/Document.cpp
View file @
da2d3644
...
...
@@ -144,6 +144,7 @@ struct DocumentP
bool
rollback
;
bool
closable
;
bool
keepTrailingDigits
;
bool
recomputeNow
;
int
iUndoMode
;
unsigned
int
UndoMemSize
;
unsigned
int
UndoMaxStackSize
;
...
...
@@ -159,6 +160,7 @@ struct DocumentP
rollback
=
false
;
closable
=
true
;
keepTrailingDigits
=
true
;
recomputeNow
=
false
;
iUndoMode
=
0
;
UndoMemSize
=
0
;
UndoMaxStackSize
=
20
;
...
...
@@ -1720,6 +1722,12 @@ void Document::_rebuildDependencyList(void)
void
Document
::
recompute
()
{
if
(
d
->
recomputeNow
)
{
throw
Base
::
RuntimeError
(
"Nested recomputes of a document are not allowed"
);
}
d
->
recomputeNow
=
true
;
// delete recompute log
for
(
std
::
vector
<
App
::
DocumentObjectExecReturn
*>::
iterator
it
=
_RecomputeLog
.
begin
();
it
!=
_RecomputeLog
.
end
();
++
it
)
delete
*
it
;
...
...
@@ -1738,6 +1746,7 @@ void Document::recompute()
}
catch
(
const
std
::
exception
&
e
)
{
std
::
cerr
<<
"Document::recompute: "
<<
e
.
what
()
<<
std
::
endl
;
d
->
recomputeNow
=
false
;
return
;
}
...
...
@@ -1824,6 +1833,7 @@ void Document::recompute()
d
->
vertexMap
.
clear
();
signalRecomputed
(
*
this
);
d
->
recomputeNow
=
false
;
}
const
char
*
Document
::
getErrorDescription
(
const
App
::
DocumentObject
*
Obj
)
const
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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