Cantera / cantera

Chemical kinetics, thermodynamics, and transport tool suite
https://cantera.org
Other
582 stars 342 forks source link

Fix segfault in deprecated newPhase factory function #1600

Closed speth closed 10 months ago

speth commented 10 months ago

The shared_ptr goes out of scope at the end of the function, deleting the held ThermoPhase right as it's returned.

Erroneous behavior introduced in f3e840dcbe (#1448).

Changes proposed in this pull request

Checklist

codecov[bot] commented 10 months ago

Codecov Report

Merging #1600 (9b55c1a) into main (8e2ab16) will increase coverage by 0.00%. The diff coverage is 58.82%.

@@           Coverage Diff           @@
##             main    #1600   +/-   ##
=======================================
  Coverage   70.59%   70.59%           
=======================================
  Files         379      379           
  Lines       59168    59185   +17     
  Branches    21257    21270   +13     
=======================================
+ Hits        41768    41781   +13     
- Misses      14324    14325    +1     
- Partials     3076     3079    +3     
Files Changed Coverage Δ
src/thermo/ThermoFactory.cpp 74.30% <58.82%> (+0.15%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more