Details
Description
After running an application that accesses the `thread()` method on the main `QApplication`, I see a segmentation fault at Python process shutdown time. It looks as though it's occurring when the shiboken atexit handlers are being run.
I'm currently seeing this on Ubuntu 22.04 Desktop (in a VM running on a macOS Ventura/Intel host), but we've also witnessed this segfault (or something very much like it) on an Ubuntu 20.04 VM, and on GitHub Actions ubuntu-22.04 runners, running under `xvfb`. Windows and macOS seem to be unaffected - this appears to be a Linux-only issue.
Here's a minimum reproducer on my machine:
```
from PySide6.QtWidgets import QApplication, QWidget
app = QApplication()
window = QWidget()
window.show()
app.thread()
app.exec()
```
When I run the above it brings up an application window as expected. When I close the window (via the close button), the process reports a segfault.
If I remove the `app.thread()` line, the segfault disappears.
The above was cut down from a much larger example, whose test suite was consistently segfaulting at process end time on every run. I've verified that removing calls to `QApplication.thread()` fixes the segfault there, too.
I should be able to get a traceback; I'll post that shortly.