diff --git a/modules/mol/base/pymod/export_editors.cc b/modules/mol/base/pymod/export_editors.cc index e204bbd2e7c190fc42b4d931a4e9a584577a4719..6dfe5e837402828563dc96a96020c06c0d2d6a37 100644 --- a/modules/mol/base/pymod/export_editors.cc +++ b/modules/mol/base/pymod/export_editors.cc @@ -266,7 +266,9 @@ void export_Editors() .def("SetTransform", set_transform1) .def("SetTransform", set_transform2) .def("UpdateICS", &XCSEditor::UpdateICS) - .def("__exit__", &XCSEditor::UpdateICS) + .def("ForceUpdate", &XCSEditor::ForceUpdate) + .def("__exit__", &XCSEditor::ForceUpdate) + .def("__del__", &XCSEditor::ForceUpdate) ; class_<ICSEditor, bases<EditorBase> >("ICSEditor", no_init) diff --git a/modules/mol/base/src/xcs_editor.cc b/modules/mol/base/src/xcs_editor.cc index 7bf68701df4f77f2a6d6246b3a08c0bfc4336ecc..4b793d33e4cba2e03526dd3a307a61d0edfdb7ab 100644 --- a/modules/mol/base/src/xcs_editor.cc +++ b/modules/mol/base/src/xcs_editor.cc @@ -218,6 +218,12 @@ void XCSEditor::Update() } } +void XCSEditor::ForceUpdate() +{ + ent_.Impl()->UpdateICSIfNeeded(); + ent_.Impl()->UpdateOrganizerIfNeeded(); +} + void XCSEditor::UpdateICS() { ent_.Impl()->UpdateICSIfNeeded(); diff --git a/modules/mol/base/src/xcs_editor.hh b/modules/mol/base/src/xcs_editor.hh index e52d9e4c5057f7f3046d6ba21646d1952caffcd7..fc992d8c9d86e53bc834a73147ddf2f70d1b748d 100644 --- a/modules/mol/base/src/xcs_editor.hh +++ b/modules/mol/base/src/xcs_editor.hh @@ -110,6 +110,10 @@ public: /// \brief immediately update internal coordinate system void UpdateICS(); + /// \brief force spatial organizer and ics update + /// workaround for delayed dtor call from Python garbage collection + void ForceUpdate(); + protected: XCSEditor(const EntityHandle& ent, EditMode mode);