aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-04 16:15:25 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-10-04 17:10:30 -0300
commit73fea931819ee1f6a32c50c9d67a9c292e69d45a (patch)
tree35b4ef441d9c343dbc27bf9a88e2e8339f19416f /PySide
parent2f8381e71213a1ecaed3ceda9ed9cdd981b79893 (diff)
Fixed QApplication cleanup.
Fixes bug #396. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtGui/glue/qapplication_init.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index be90d10ad..d082b99f1 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -11,18 +11,18 @@ void DeleteQApplicationAtExit()
QCoreApplication* cpp = QApplication::instance();
if (cpp) {
Shiboken::BindingManager &bmngr = Shiboken::BindingManager::instance();
- cpp->flush();
// Delete all widgets, this is slow but is necessary to avoid problems with python object
foreach(QWidget* w, QApplication::allWidgets()) {
- w->deleteLater();
- //Make sure all events will send before invalidated the python object
- QApplication::processEvents();
- bmngr.destroyWrapper(w);
+ PyObject* wrapper = bmngr.retrieveWrapper(w);
+ if (wrapper) {
+ if (SbkBaseWrapper_hasOwnership(wrapper))
+ delete w; // destroy C++ object and invalidate wrapper object
+ else
+ bmngr.destroyWrapper(wrapper); // only invalidate wrapper object
+ }
}
-
- cpp->processEvents();
- bmngr.destroyWrapper(cpp);
+ cpp->flush();
delete cpp;
}
}