russcip
russcip copied to clipboard
Add lifetime to solving such that clone_for_plugins is not leaking
As part of #151, I added a lifetime to Solving
to prevent clone_for_plugins
from leaking.
This requires include_branch_rule
, include_heur
and include_pricer
to not only accept "callbacks" of 'static
lifetimes, but also "callbacks" of shorter lifetime.
This means that include_branch_rule
, include_heur
and include_pricer
cannot consume self
:/, as the callback should live as much as model is live. This goes a bit against the builder pattern that this library uses.
Would like some comments on the code. I still have to think hard if this code does not have memory errors.