Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix macOS toolbar crash#30863

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
greglucas merged 1 commit intomatplotlib:mainfromlilfer:fix-macosx-toolbar-crash
Dec 15, 2025

Conversation

@lilfer
Copy link
Contributor

PR summary

Closes#28513
Fixes a segmentation fault in the _macosx backend that occurs when closing figures.
In the original implementation ofNavigationToolbar2, it relied on the window to hold the only strong reference tomessagebox. The toolbar sometimes living longer than the window—and thusmessagebox— resulted in the crash.
I'm still not sure why this crash seems to only occur when closing a figure that was created in the event loop.

Fix:NavigationToolbar2 now also retainsmessagebox.

I checked thatmessagebox is deallocated after a figure is closed andgc.collect() runs.

PR checklist

@tacaswelltacaswell added this to thev3.11.0 milestoneDec 15, 2025
Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Makes sense and I manually tested.

@greglucasgreglucas merged commit9e210e8 intomatplotlib:mainDec 15, 2025
33 of 38 checks passed
@greglucas
Copy link
Contributor

Thanks@lilfer! If you're in macos backend bug squashing mode, there are several other similar reference counting issues hanging around I think if you have any ideas for those too:https://github.com/matplotlib/matplotlib/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22GUI%3A%20MacOSX%22

lilfer reacted with heart emoji

@lilferlilfer deleted the fix-macosx-toolbar-crash branchDecember 15, 2025 21:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tacaswelltacaswelltacaswell approved these changes

@greglucasgreglucasgreglucas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

v3.11.0

Development

Successfully merging this pull request may close these issues.

[Bug]: Segfault when usingclose_event with macosx backend and tk

3 participants

@lilfer@greglucas@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp