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

Ambiguous references in clib's Cabinet<M>::index #1756

Closed
ischoegl opened this issue Aug 3, 2024 · 0 comments · Fixed by #1754
Closed

Ambiguous references in clib's Cabinet<M>::index #1756

ischoegl opened this issue Aug 3, 2024 · 0 comments · Fixed by #1754

Comments

@ischoegl
Copy link
Member

ischoegl commented Aug 3, 2024

Problem description

When calling a destructor for a Solution object via soln_del using the clib API, associated ThermoPhase, Kinetics and Transport objects are deallocated. As integer entry numbers ('handles') are not available, the destructor relies on Cabinet<M>::index, which returns the last entry of a reverse lookup table. There is no guarantee that the correct entry is removed, leading to potentially unpredictable behavior and memory leaks.

System information

  • Cantera version: 3.1a3
  • OS: any
  • Python/MATLAB/other software versions: N/A

Additional context

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

Successfully merging a pull request may close this issue.

1 participant