From e365f3ed6ca874284fd599b8ce10932edf07f5fa Mon Sep 17 00:00:00 2001 From: NT_x86 Date: Fri, 31 Mar 2023 14:31:34 +0300 Subject: [PATCH] Open new place crash workaround Reloads jointsservice on place open --- src/source/DataModelV2/DataModelInstance.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/source/DataModelV2/DataModelInstance.cpp b/src/source/DataModelV2/DataModelInstance.cpp index 79111de..24b43f8 100644 --- a/src/source/DataModelV2/DataModelInstance.cpp +++ b/src/source/DataModelV2/DataModelInstance.cpp @@ -504,8 +504,12 @@ bool DataModelInstance::load(const char* filename, bool clearObjects) std::string tname = hname.substr(0, hname.length() - 5); name = tname; resetEngine(); + //HACK: we need to reset JointsService but there is no good way to do it in XplicitNgine code + jointsService = new JointsService(); + jointsService->setParent(this); selectionService->clearSelection(); selectionService->addSelected(this); + jointsService->solveWorkspaceSnaps(); return true; } else