Skip to content

[Python][RF] Set correct Python-side ownership to function return values#21600

Merged
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:set_ownership
Mar 14, 2026
Merged

[Python][RF] Set correct Python-side ownership to function return values#21600
guitargeek merged 1 commit intoroot-project:masterfrom
guitargeek:set_ownership

Conversation

@guitargeek
Copy link
Contributor

We still have no mechanism to annotate C++ signatures to flag to cppyy that the returned value needs to be manually deleted. Thils should be prioritized after the current upgrade to the new compiler toolchain.

Until then, RooFit methods need to be manually Pythonized for clear ownership to avoid memory leaks, such as the one reported on the forum:

https://root-forum.cern.ch/t/how-to-clean-delete-properly-roodataset-in-pyroot/64749

Copy link
Member

@vepadulano vepadulano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix! LGTM if the CI is green.

We still have no mechanism to annotate C++ signatures to flag to cppyy
that the returned value needs to be manually deleted. Thils should be
prioritized after the current upgrade to the new compiler toolchain.

Until then, RooFit methods need to be manually Pythonized for clear
ownership to avoid memory leaks, such as the one reported on the forum:

https://root-forum.cern.ch/t/how-to-clean-delete-properly-roodataset-in-pyroot/64749
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

Test Results

    22 files      22 suites   3d 1h 47m 18s ⏱️
 3 807 tests  3 805 ✅ 1 💤 1 ❌
75 808 runs  75 798 ✅ 9 💤 1 ❌

For more details on these failures, see this check.

Results for commit 87a8aa0.

♻️ This comment has been updated with latest results.

@guitargeek guitargeek merged commit ee79dfd into root-project:master Mar 14, 2026
38 of 53 checks passed
@guitargeek guitargeek deleted the set_ownership branch March 14, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants