]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0022221: [CEA 819] Error "'NoneType' object is not callable" at Salome closure
authorvsr <vsr@opencascade.com>
Wed, 11 Sep 2013 16:27:56 +0000 (16:27 +0000)
committervsr <vsr@opencascade.com>
Wed, 11 Sep 2013 16:27:56 +0000 (16:27 +0000)
src/GEOMGUI/GeometryGUI.cxx

index c11a4d34d5f4a80b23bc4156d57786c6a609b16f..4456b351921614dce8d54f54aee5592c886d4d0a 100644 (file)
@@ -49,6 +49,8 @@
 #include <SUIT_Session.h>
 #include <SUIT_ViewManager.h>
 
+#include <PyInterp_Interp.h>
+
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewModel.h>
@@ -1709,17 +1711,17 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
 
   // import Python module that manages GEOM 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 =
+    PyObjWrapper result =
       PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
                           tr("MEN_NEW_ENTITY").toStdString().c_str(),
                           tr("GEOM_PLUGINS_OTHER").toStdString().c_str());
-    if (result == NULL)
+    if ( !result )
       PyErr_Print();
-    Py_XDECREF(result);
   }
   PyGILState_Release(gstate);
   // end of GEOM plugins loading