summaryrefslogtreecommitdiffstats
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>2011-10-19 15:11:43 -0200
commitd68c6b99a6f376bf893c43689bae5d3004a13473 (patch)
tree6ca918f2fd26659ae9462cb00afa4445a0a16442
parent5e8a7ef5f0f566f7545f884283bc41f59bf51613 (diff)
downloadpyside-d68c6b99a6f376bf893c43689bae5d3004a13473.tar.gz
pyside-d68c6b99a6f376bf893c43689bae5d3004a13473.tar.xz
pyside-d68c6b99a6f376bf893c43689bae5d3004a13473.zip
Only removes actions bounded to PyObjects on QMenu::clear.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-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 d3b0c55..4b0785b 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>