Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A more robust solution might be to add a lifetime directly to ScipPtr. So have OwnedScip and ScipRef<'a> instead of the consumed field. #151

Open
mmghannam opened this issue Sep 13, 2024 · 1 comment

Comments

@mmghannam
Copy link
Member

          A more robust solution might be to add a lifetime directly to `ScipPtr`. So have `OwnedScip` and `ScipRef<'a>` instead of the `consumed` field.

Originally posted by @Andful in #149 (comment)

@Andful
Copy link

Andful commented Sep 17, 2024

Oh, was not expecting the pull request to be merged without sparking any discussion.

I am a bit busy currently to implement this , but maybe, just to get an idea of the scope, I have a few questions:

  • What is the purpose of clone_for_plugin? From my understanding it is used in callbacks to query model information, e.g. during branching.
  • Is it needed? I think, as of now, it suffers from the same problems as in segfault (use after free) when accessing solution after model is dropped #138 (By accessing the clone after the main model is dropped). I think it might be better just to remove it all together. If someone wants a shallow-copy(or a reference), the user can either choose to use a reference (&Model) or a reference-counting pointer (Rc<Model> & Arc<Model>).
  • Would it be fine to remove it (given that I fix the tests)? It would be an API breaking change :/, and some users might not love it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants