Skip to content

[Python] Release Python ownership of TCanvas registered to gROOT#22209

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:issue-21942
Open

[Python] Release Python ownership of TCanvas registered to gROOT#22209
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:issue-21942

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

Following the pattern already used for TH1/TFile/etc., drop Python ownership in the TCanvas constructor pythonization once the canvas is in gROOT's list of canvases.

This fixes a Jupyter kernel crash where re-running a cell that creates a TCanvas with the same name would double-delete the C++ object: The TCanvas constructor triggers deletion of the old same-name canvas, but the previous Python proxy still thought it owned the object and tried to delete it again on finalization.

Close #21942.

Following the pattern already used for TH1/TFile/etc., drop Python
ownership in the TCanvas constructor pythonization once the canvas is in
`gROOT`'s list of canvases.

This fixes a Jupyter kernel crash where re-running a cell that creates a
TCanvas with the same name would double-delete the C++ object: The
TCanvas constructor triggers deletion of the old same-name canvas, but
the previous Python proxy still thought it owned the object and tried to
delete it again on finalization.

Close root-project#21942.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 10, 2026

Test Results

    22 files      22 suites   3d 8h 15m 43s ⏱️
 3 847 tests  3 846 ✅ 0 💤 1 ❌
75 989 runs  75 987 ✅ 1 💤 1 ❌

For more details on these failures, see this check.

Results for commit 3f29630.

♻️ This comment has been updated with latest results.

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.

Jupyter ROOT kernel crashes on cell revision

1 participant