From 39b656bb9f1231fc394b47c7c639800e6a2e4a30 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 12 Sep 2013 14:18:54 +0000 Subject: [PATCH] 0022221: [CEA 819] Error "'NoneType' object is not callable" at Salome closure --- src/SMESHGUI/SMESHGUI.cxx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 7c2eb1ace..e3fb6fcd1 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -116,6 +116,8 @@ #include +#include + #include #include #include @@ -4603,18 +4605,17 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) // import Python module that manages SMESH plugins (need to be here because SalomePyQt API uses active module) PyGILState_STATE gstate = PyGILState_Ensure(); - PyObject* pluginsmanager=PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); - if(pluginsmanager==NULL) + PyObjWrapper pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager"); + if ( !pluginsmanager ) { PyErr_Print(); - else - { - PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"smesh",tr("MEN_MESH").toStdString().c_str(),tr("SMESH_PLUGINS_OTHER").toStdString().c_str()); - if(result==NULL) - PyErr_Print(); - Py_XDECREF(result); - } + } + else { + PyObjWrapper result = PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"smesh",tr("MEN_MESH").toStdString().c_str(),tr("SMESH_PLUGINS_OTHER").toStdString().c_str()); + if ( !result ) + PyErr_Print(); + } PyGILState_Release(gstate); - // end of GEOM plugins loading + // end of SMESH plugins loading // Reset actions accelerator keys //action(111)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); // Import DAT -- 2.39.2