From 303fccac0642f6b4320648591952e635ba6d399e Mon Sep 17 00:00:00 2001
From: Xavier Robin <xavalias-github@xavier.robin.name>
Date: Thu, 6 Jun 2024 14:41:10 +0200
Subject: [PATCH] fix: StructRefs setter and getters need more wrapping

---
 modules/io/pymod/export_mmcif_io.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/io/pymod/export_mmcif_io.cc b/modules/io/pymod/export_mmcif_io.cc
index f65daf603..551103b88 100644
--- a/modules/io/pymod/export_mmcif_io.cc
+++ b/modules/io/pymod/export_mmcif_io.cc
@@ -525,8 +525,10 @@ void export_mmcif_io()
                                    return_value_policy<copy_const_reference>()))
     .def("SetStructDetails", &MMCifInfo::SetStructDetails)
     .def("GetStructDetails", &MMCifInfo::GetStructDetails)
-    .def("SetStructRefs", &MMCifInfo::SetStructRefs)
-    .def("GetStructRefs", &MMCifInfo::GetStructRefs)
+    .def("SetStructRefs", make_function(&MMCifInfo::SetStructRefs,
+                                   return_value_policy<copy_const_reference>()))
+    .def("GetStructRefs", make_function(&MMCifInfo::GetStructRefs,
+                                   return_value_policy<copy_const_reference>()))
     .def("SetObsoleteInfo", &MMCifInfo::SetObsoleteInfo)
     .def("GetObsoleteInfo", &MMCifInfo::GetObsoleteInfo)
     .def("AddMMCifPDBChainTr", &MMCifInfo::AddMMCifPDBChainTr)
-- 
GitLab