Closed bcoconni closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
952ef8d
) 24.87% compared to head (d30e99f
) 24.87%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
For those wondering what the difference is between FGPropertyNode
and SGPropertyNode
:
FGPropertyNode
inherits from SGPropertyNode
https://github.com/JSBSim-Team/jsbsim/blob/952ef8df81b8ef596c7f29b3d53f0a0cafd5463e/src/input_output/FGPropertyManager.h#L72SGPropertyNode
by inheriting SGReferenced
https://github.com/JSBSim-Team/jsbsim/blob/952ef8df81b8ef596c7f29b3d53f0a0cafd5463e/src/simgear/props/props.hxx#L755Thanks @bcoconni, well done
@bcoconni @agodemar quite a milestone, the 1000th pull request for the JSBSim repo at Github! :wink:
It's actually the 298th-ish PR: the number 1000 is actually a counter that accumulates over all the items in the repo (PR, issues and discussions).
That's quite a feat nonetheless. Congrats to the community 🥳
This PR modifies the Python binding of
FGPropertyNode
so that the reference counting of theSGPropertyNode
instance that it points to is updated.This is to avoid that the C++ instance of
FGPropertyNode
/SGPropertyNode
that the Python object relies on is being deleted by another event. Such a scenario would result in a dangling pointer and eventually to a segfault of the Python interpreter.In other words, this PR is meant to avoid the scenario below from occurring.