Ticket #9818 (new)

Opened 6 years ago

Last modified 5 years ago

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.

Change History

comment:1 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10660

Note: See TracTickets for help on using tickets.