Ticket #9818 (new)
CatalogManager const references need refactoring
Reported by: | Owen Arnold | Owned by: | Anyone |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Framework | Keywords: | Maintenance |
Cc: | peter.parker@… | Blocked By: | |
Blocking: | Tester: |
Description
As identified by peter http://trac.mantidproject.org/mantid/ticket/9084#comment:58 const ref return types from CatalogManager are asking for trouble. I've already fallen foul of these.
See https://github.com/mantidproject/mantid/blob/master/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp#L863 for why a const reference needs to be used in order to avoid a dangling pointer when the soapEndPoint call return goes out of scope!
This might be avoided if the ICat4Cat cached the soapEndPoint (and anything else it needs a const ref for) at construction time. If the soapEndPoint string was extracted, copied and object scoped, it would remain valid for the lifetime of the ICat4Cat object.
This ticket has been transferred to github issue 10660