Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Safer close #127

Merged
merged 1 commit into from
Oct 5, 2021
Merged

FIX: Safer close #127

merged 1 commit into from
Oct 5, 2021

Conversation

larsoner
Copy link
Contributor

@larsoner larsoner commented Oct 5, 2021

Qt callbacks should never raise an error or you get a segfault:

https://github.com/mne-tools/mne-python/pull/9803/checks?check_run_id=3796599057

E   subprocess.CalledProcessError: Command '['/opt/hostedtoolcache/Python/3.9.7/x64/bin/python', '-uc', "import mne; mne.viz.create_3d_figure((800, 600)); backend = mne.viz.get_3d_backend(); assert backend == 'pyvistaqt', backend"]' died with <Signals.SIGABRT: 6>.
...
Traceback (most recent call last):

  File "/opt/hostedtoolcache/Python/3.9.7/x64/lib/python3.9/site-packages/pyvistaqt/plotting.py", line 602, in close

    self.app_window.close()

RuntimeError: wrapped C/C++ object of type MainWindow has been deleted

This PR just more safely wraps the handler in a try/except to avoid this.

Copy link
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

GitHub actions appears to be degraded at the moment...

@larsoner
Copy link
Contributor Author

larsoner commented Oct 5, 2021

@akaszynski thanks for the quick review. @GuillaumeFavelier can you look and merge if you're happy?

Copy link
Contributor

@GuillaumeFavelier GuillaumeFavelier left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the addition @larsoner

@GuillaumeFavelier GuillaumeFavelier merged commit 3ab8537 into pyvista:main Oct 5, 2021
@larsoner larsoner mentioned this pull request Dec 7, 2021
@larsoner larsoner deleted the close branch December 7, 2021 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants