From 6acb5f9bc77d583f2d9a1fcd896ace193019b4fb Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 17 Oct 2011 17:45:03 -0200 Subject: Only removes actions bounded to PyObjects on QMenu::clear. Reviewer: Marcelo Lira Luciano Wolf --- PySide/QtGui/typesystem_gui_common.xml | 13 +++++++++---- 1 file 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 @@ - foreach(QAction *act, %CPPSELF.actions()) { - Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act)); - Shiboken::Object::setParent(NULL, pyAct); - Shiboken::Object::invalidate(pyAct); + Shiboken::BindingManager& 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); + } } -- cgit v1.2.3