Crash after commit "[TD] Detail view - add missing update"

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Crash after commit "[TD] Detail view - add missing update"

Post by gauna »

Freecad included the named patch crashes with a segmentation fault while opening my document.
I located the following introducing the regression:

Committer WandererFan<WandererFan@gmail.com>
Author donovaly<uwestoehr@lyx.org>
Author date 26.03.20 01:40
Parent [TD] Detail view - add missing update

Obviously the calling order of two functions is changed. I created the following patch and was able to open my document again:
src/Mod/TechDraw/App/DrawProjGroup.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Mod/TechDraw/App/DrawProjGroup.cpp b/src/Mod/TechDraw/App/DrawProjGroup.cpp
index c63dd05d3..5832df07f 100644
--- a/src/Mod/TechDraw/App/DrawProjGroup.cpp
+++ b/src/Mod/TechDraw/App/DrawProjGroup.cpp
@@ -425,8 +425,8 @@ App::DocumentObject * DrawProjGroup::addProjection(const char *viewProjType)
}
if (view != nullptr) { //coverity CID 151722
// the label must be set before the view is added
- view->Label.setValue(viewProjType);
addView(view); //from DrawViewCollection
+ view->Label.setValue(viewProjType);
view->Source.setValues(Source.getValues());
// the Scale is already set by DrawView
view->Type.setValue(viewProjType);
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Crash after commit "[TD] Detail view - add missing update"

Post by wandererfan »

gauna wrote: Sat Mar 28, 2020 6:34 pm Freecad included the named patch crashes with a segmentation fault while opening my document.
Can you post or pm your file for testing please?

I think there is also something else going on.

Thanks.
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Re: Crash after commit "[TD] Detail view - add missing update"

Post by gauna »

Here is my testfile.
Attachments
Korpus.FCStd
(262.83 KiB) Downloaded 16 times
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Crash after commit "[TD] Detail view - add missing update"

Post by wandererfan »

gauna wrote: Sun Mar 29, 2020 8:44 am Here is my testfile.
Thanks for the file. The crash should be fixed by git commit 0f477df6ed
gauna
Posts: 49
Joined: Fri Dec 04, 2015 8:20 pm

Re: Crash after commit "[TD] Detail view - add missing update"

Post by gauna »

Thanks for the fix. I will test it.
Post Reply