path: root/sources/pyside2/libpyside
diff options
authorChristian Tismer <tismer@stackless.com>2018-03-23 19:54:42 +0100
committerChristian Tismer <tismer@stackless.com>2018-04-19 11:20:51 +0000
commita89690409972501741c846ac8ad4a499f2982809 (patch)
tree7684abfa34b4c9aa66ab317452da37ccc1f8f31e /sources/pyside2/libpyside
parent4023ab3862eee7ca3084dd83ca76fba11b5db46b (diff)
fix more qApp crashes
When building PySide with a debug Python, a lot more problems become visible. They were triggered by some malicious ordering of the shutdown code, which must come *after* the refcounts of the variables are adjusted. The initial issue PYSIDE-585 was caused because the shutdown code is not only used for every created Q*Application, but also for the module shutdown, which deletes qApp_contents too often. Instead of special-casing that or adding some refcount, it was much more intuitive in that context to set qApp_content's refcount to the same value as Py_None, which also is not supposed to be garbage collected. Btw., the reason for the error message is that Py_None has it, too. When we set qApp_content's type to Py_None's type, it inherits the protection code that prevents someone from garbage collecting Py_None. Task-number: PYSIDE-585 Change-Id: I4af9de1192730f06054a5aca099a32e2392e367d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/libpyside')
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp
index b223edc6..4c7e6471 100644
--- a/sources/pyside2/libpyside/pyside.cpp
+++ b/sources/pyside2/libpyside/pyside.cpp
@@ -162,10 +162,10 @@ static void destructionVisitor(SbkObject* pyObj, void* data)
void destroyQCoreApplication()
- SignalManager::instance().clear();
QCoreApplication* app = QCoreApplication::instance();
if (!app)
+ SignalManager::instance().clear();
Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
SbkObject* pyQApp = bm.retrieveWrapper(app);