aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/typesystem_gui_common.xml
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-10-17 17:45:03 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:56:14 -0300
commit6acb5f9bc77d583f2d9a1fcd896ace193019b4fb (patch)
treee17cb447f65e45f502028e220fda3e24776ef71a /PySide/QtGui/typesystem_gui_common.xml
parent9f05c7dad5e245b7687905ac21fa29a33c6d291c (diff)
Only removes actions bounded to PyObjects on QMenu::clear.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide/QtGui/typesystem_gui_common.xml')
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml13
1 files changed, 9 insertions, 4 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index d3b0c5593..4b0785b23 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2399,10 +2399,15 @@
<modify-function signature="clear()">
<inject-code>
- foreach(QAction *act, %CPPSELF.actions()) {
- Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
- Shiboken::Object::setParent(NULL, pyAct);
- Shiboken::Object::invalidate(pyAct);
+ Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
+ PyObject* pyObj;
+ foreach(QAction* act, %CPPSELF.actions()) {
+ if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) {
+ Py_INCREF(pyObj);
+ Shiboken::Object::setParent(NULL, pyObj);
+ Shiboken::Object::invalidate(pyObj);
+ Py_DECREF(pyObj);
+ }
}
</inject-code>
</modify-function>