Skip to content
Snippets Groups Projects
Commit d3344253 authored by Ian Bell's avatar Ian Bell
Browse files

Fix memory problem with getter using temporary

parent 2f935064
No related branches found
No related tags found
No related merge requests found
......@@ -61,10 +61,9 @@ inline auto call_method_factory(py::module &m, const std::string& attribute) {
}
template<typename TYPE>
TYPE& get_typed(py::object& o){
const TYPE& get_typed(py::object& o){
using namespace teqp::cppinterface;
auto model = o.cast<const AbstractModel *>()->get_model();
return std::get<TYPE>(model);
return std::get<TYPE>(o.cast<const AbstractModel *>()->get_model());
}
// You cannot know at runtime what is contained in the model so you must iterate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment