You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, what's wrong, and what you expected.
Segmentation fault happens after closing the Plotter window, when it's called from a PyQt5 application.
Apparently, it happens upon returning to the PyQt application event loop when garbage collection occurs, because the line 'x=0' executes fine.
I have tried running the example with earlier versions of Pyvista and at version 0.36.0 the SIGSEGV doesn't happen.
Steps to reproduce the bug.
Here is a code with minimal PyQt5 interface with a button.
Clicking the button and closing the window with the Sphere should cause SIGSEGV.
importsysimportpyvistaaspvfromPyQt5.QtCoreimportQSize, QtfromPyQt5.QtWidgetsimportQApplication, QMainWindow, QPushButtondefshow_pyvista_example():
pv.Sphere().plot()
classMainWindow(QMainWindow):
def__init__(self):
super().__init__()
self.setWindowTitle("My App")
self.button=QPushButton("Press Me!")
# Set the central widget of the Window.self.setCentralWidget(self.button)
self.button.clicked.connect(self.show_sphere)
defshow_sphere(self):
show_pyvista_example()
x=0return1app=QApplication(sys.argv)
window=MainWindow()
window.show()
app.exec()
You haven't used pyvistaqt at all to do this plotting but rather pyvista. So this is either a pyvista bug or -- I would probably argue -- a usage bug where if you want to use pyvista + Qt you should use pyvistaqt.BackgroundPlotter not pyvista.Plotter. Can you try incorporating BackgroundPlotter and adding your sphere to it instead of using pv.Sphere.plot() (which will create a pyvista.Plotter)?
Describe the bug, what's wrong, and what you expected.
Segmentation fault happens after closing the Plotter window, when it's called from a PyQt5 application.
Apparently, it happens upon returning to the PyQt application event loop when garbage collection occurs, because the line 'x=0' executes fine.
I have tried running the example with earlier versions of Pyvista and at version 0.36.0 the SIGSEGV doesn't happen.
Steps to reproduce the bug.
Here is a code with minimal PyQt5 interface with a button.
Clicking the button and closing the window with the Sphere should cause SIGSEGV.
System Information
Screenshots
No response
The text was updated successfully, but these errors were encountered: