Closed mmghannam closed 1 year ago
Branch issue-16-Possible_dangling_raw_pointers created!
Fixed in #20
Let's maybe add more tests before marking this as closed ? A quick look at the code doesn't seem like it is really guaranteeing correct memory management. If the current logic is perfectly sound, maybe add some comments to explain what are the invariants and how they are enforced ?
Update: Added a memory leak test to CI in #26
A quick look seems to indicate that one could drop the model but keep variables, or a solution, that still contain a pointer to the scip struct.
You should probably be more careful with copying raw pointers. At least, write a comment explaining why you think it's safe every time. At best, just never do it, make a single rust struct for each type of C pointer, and then manage that memory with traditional rust memory management.
_Originally posted by @lovasoa in https://github.com/mmghannam/russcip/pull/13#discussion_r1111264447_