From e91954d62918e6bc9759743ecfc9f3d6a8f40693 Mon Sep 17 00:00:00 2001 From: Gerardo Tauriello <gerardo.tauriello@unibas.ch> Date: Mon, 4 Jun 2018 15:05:23 +0200 Subject: [PATCH] SCHWED-3292: fixed segfault for EntityView.RemoveChain with GetChainList. Combination of reference_existing_object and RemoveChain can lead to segfaults. Overhead of change is 1us per call for a test case with 18 chains. Hence it is absolutely negligible. --- modules/mol/base/pymod/export_entity_view.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mol/base/pymod/export_entity_view.cc b/modules/mol/base/pymod/export_entity_view.cc index 2422c154a..19781a94f 100644 --- a/modules/mol/base/pymod/export_entity_view.cc +++ b/modules/mol/base/pymod/export_entity_view.cc @@ -197,10 +197,10 @@ void export_EntityView() make_function(&EntityView::GetBondList, return_value_policy<reference_existing_object>())) .def("GetChainList", &EntityView::GetChainList, - return_value_policy<reference_existing_object>()) + return_value_policy<copy_const_reference>()) .add_property("chains", make_function(&EntityView::GetChainList, - return_value_policy<reference_existing_object>())) + return_value_policy<copy_const_reference>())) .def(self==self) .def(self!=self) .def("Dump", &EntityView::Dump) -- GitLab