Re: [RFC 8/8] mi/python: Allow redefinition of python MI commands

Jan Vrany
2019-05-07T13:19:28Z

On Tue, 2019-05-07 at 09:09 -0400, Simon Marchi wrote:
> On 2019-05-07 7:25 a.m., Jan Vrany wrote:
> > I see. I just added a test for this case into "almost finished"
> > v2 of the patch series. There, this problem is kind of avoided by
> > making sure that in mi_command_py::invoke anything from "this"
> > mi_command_py object is not accessed AFTER calling the python code.
> >
> > However I agree that using shared_ptr is more robust solution.
>
> If we know that we don't access that pointer after it is possibly stale, and
> we document that fact properly, I think we can keep what you had initially.
> Using shared_ptr has a cost, and it's not really essential here.
>

All right. Thanks!

Jan

> Simon