From a56a73c82cdd403b1120c06cf748a1d63481eb22 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 24 Nov 2014 18:06:54 +0300 Subject: [PATCH] Remove obsolete patches --- config_files/patches/OCCT-6.7.1.patch | 202 ---------- config_files/patches/ParaView-4.1.0.patch | 434 ---------------------- 2 files changed, 636 deletions(-) delete mode 100644 config_files/patches/OCCT-6.7.1.patch delete mode 100644 config_files/patches/ParaView-4.1.0.patch diff --git a/config_files/patches/OCCT-6.7.1.patch b/config_files/patches/OCCT-6.7.1.patch deleted file mode 100644 index 985c389..0000000 --- a/config_files/patches/OCCT-6.7.1.patch +++ /dev/null @@ -1,202 +0,0 @@ ---- OCCT-6.7.1_SRC/inc/BRepFill_PipeShell.hxx 2014-04-30 14:16:07.000000000 +0400 -+++ cr24985/inc/BRepFill_PipeShell.hxx 2014-06-30 14:46:17.000000000 +0400 -@@ -31,6 +31,9 @@ - #ifndef _Standard_Real_HeaderFile - #include - #endif -+#ifndef _Standard_Integer_HeaderFile -+#include -+#endif - #ifndef _Standard_Boolean_HeaderFile - #include - #endif -@@ -61,9 +64,6 @@ - #ifndef _BRepFill_TypeOfContact_HeaderFile - #include - #endif --#ifndef _Standard_Integer_HeaderFile --#include --#endif - class Law_Function; - class BRepFill_LocationLaw; - class BRepFill_SectionLaw; -@@ -127,6 +127,11 @@ - //! becomes a boundary of the swept surface and the width of section varies
- //! along the path.
- Standard_EXPORT void Set(const TopoDS_Wire& AuxiliarySpine,const Standard_Boolean CurvilinearEquivalence = Standard_True,const BRepFill_TypeOfContact KeepContact = BRepFill_NoContact) ; -+ //! Define the maximum V degree of resulting surface
-+ Standard_EXPORT void SetMaxDegree(const Standard_Integer NewMaxDegree) ; -+ //! Define the maximum number of spans in V-direction
-+//! on resulting surface
-+ Standard_EXPORT void SetMaxSegments(const Standard_Integer NewMaxSegments) ; - //! Set the flag that indicates attempt to approximate
- //! a C1-continuous surface if a swept surface proved
- //! to be C0.
//! Give section to sweep.
-@@ -212,6 +217,8 @@ - Standard_Real myTolAngular; - Standard_Real angmin; - Standard_Real angmax; -+Standard_Integer myMaxDegree; -+Standard_Integer myMaxSegments; - Standard_Boolean myForceApproxC1; - Handle_Law_Function myLaw; - Standard_Boolean myIsAutomaticLaw; ---- OCCT-6.7.1_SRC/inc/BRepOffsetAPI_MakePipeShell.hxx 2014-04-30 14:16:14.000000000 +0400 -+++ cr24985/inc/BRepOffsetAPI_MakePipeShell.hxx 2014-06-30 14:46:24.000000000 +0400 -@@ -37,12 +37,12 @@ - #ifndef _Standard_Real_HeaderFile - #include - #endif --#ifndef _BRepBuilderAPI_TransitionMode_HeaderFile --#include --#endif - #ifndef _Standard_Integer_HeaderFile - #include - #endif -+#ifndef _BRepBuilderAPI_TransitionMode_HeaderFile -+#include -+#endif - class BRepFill_PipeShell; - class Standard_DomainError; - class StdFail_NotDone; -@@ -177,6 +177,11 @@ - //! - boundary tolerance BoundTol
- //! - angular tolerance TolAngular.
- Standard_EXPORT void SetTolerance(const Standard_Real Tol3d = 1.0e-4,const Standard_Real BoundTol = 1.0e-4,const Standard_Real TolAngular = 1.0e-2) ; -+ //! Define the maximum V degree of resulting surface
-+ Standard_EXPORT void SetMaxDegree(const Standard_Integer NewMaxDegree) ; -+ //! Define the maximum number of spans in V-direction
-+//! on resulting surface
-+ Standard_EXPORT void SetMaxSegments(const Standard_Integer NewMaxSegments) ; - //! Set the flag that indicates attempt to approximate
- //! a C1-continuous surface if a swept surface proved
- //! to be C0.
---- OCCT-6.7.1_SRC/src/BRepFill/BRepFill_PipeShell.cdl 2014-04-30 14:10:12.000000000 +0400 -+++ cr24985/src/BRepFill/BRepFill_PipeShell.cdl 2014-06-30 14:35:15.000000000 +0400 -@@ -115,6 +115,19 @@ - - ---Level: Public - -+ -+-- ============================================ -+-- Methods to set parameters for approximation -+-- ============================================ -+ SetMaxDegree(me : mutable; -+ NewMaxDegree : Integer from Standard); -+ ---Purpose: Define the maximum V degree of resulting surface -+ -+ SetMaxSegments(me : mutable; -+ NewMaxSegments : Integer from Standard); -+ ---Purpose: Define the maximum number of spans in V-direction -+ -- on resulting surface -+ - SetForceApproxC1(me : mutable; - ForceApproxC1 : Boolean from Standard); - ---Purpose: Set the flag that indicates attempt to approximate -@@ -289,6 +302,8 @@ - myBoundTol : Real; - myTolAngular : Real; - angmin, angmax : Real; -+ myMaxDegree : Integer; -+ myMaxSegments : Integer; - myForceApproxC1 : Boolean; - - myLaw : Function from Law; ---- OCCT-6.7.1_SRC/src/BRepFill/BRepFill_PipeShell.cxx 2014-04-30 14:10:12.000000000 +0400 -+++ cr24985/src/BRepFill/BRepFill_PipeShell.cxx 2014-06-30 14:35:15.000000000 +0400 -@@ -226,6 +226,9 @@ - myLaw.Nullify(); - SetTolerance(); - -+ myMaxDegree = 11; -+ myMaxSegments = 30; -+ - // Attention to closed non-declared wire ! - if (!mySpine.Closed()) { - TopoDS_Vertex Vf, Vl; -@@ -414,6 +417,25 @@ - mySection.Nullify(); //It is required to relocalize the sections. - } - -+ -+//======================================================================= -+//function : SetMaxDegree -+//purpose : -+//======================================================================= -+void BRepFill_PipeShell::SetMaxDegree(const Standard_Integer NewMaxDegree) -+{ -+ myMaxDegree = NewMaxDegree; -+} -+ -+//======================================================================= -+//function : SetMaxSegments -+//purpose : -+//======================================================================= -+void BRepFill_PipeShell::SetMaxSegments(const Standard_Integer NewMaxSegments) -+{ -+ myMaxSegments = NewMaxSegments; -+} -+ - //======================================================================= - //function : SetForceApproxC1 - //purpose : Set the flag that indicates attempt to approximate -@@ -742,7 +764,8 @@ - theContinuity = GeomAbs_C0; - TopTools_MapOfShape Dummy; - BRepFill_DataMapOfShapeHArray2OfShape Dummy2; -- MkSw.Build(Dummy, Dummy2, myTransition, theContinuity); -+ MkSw.Build(Dummy, Dummy2, myTransition, theContinuity, -+ GeomFill_Location, myMaxDegree, myMaxSegments); - - myStatus = myLocation->GetStatus(); - Ok = (MkSw.IsDone() && (myStatus == GeomFill_PipeOk)); ---- OCCT-6.7.1_SRC/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cdl 2014-04-30 14:10:13.000000000 +0400 -+++ cr24985/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cdl 2014-06-30 14:35:15.000000000 +0400 -@@ -221,6 +221,20 @@ - -- - boundary tolerance BoundTol - -- - angular tolerance TolAngular. - -+ -+ -+-- ============================================ -+-- Methods to set parameters for approximation -+-- ============================================ -+ SetMaxDegree(me : in out; -+ NewMaxDegree : Integer from Standard); -+ ---Purpose: Define the maximum V degree of resulting surface -+ -+ SetMaxSegments(me : in out; -+ NewMaxSegments : Integer from Standard); -+ ---Purpose: Define the maximum number of spans in V-direction -+ -- on resulting surface -+ - SetForceApproxC1(me : in out; - ForceApproxC1 : Boolean from Standard); - ---Purpose: Set the flag that indicates attempt to approximate ---- OCCT-6.7.1_SRC/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx 2014-04-30 14:10:13.000000000 +0400 -+++ cr24985/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx 2014-06-30 14:35:15.000000000 +0400 -@@ -201,6 +201,24 @@ - } - - //======================================================================= -+//function : SetMaxDegree -+//purpose : -+//======================================================================= -+void BRepOffsetAPI_MakePipeShell::SetMaxDegree(const Standard_Integer NewMaxDegree) -+{ -+ myPipe->SetMaxDegree(NewMaxDegree); -+} -+ -+//======================================================================= -+//function : SetMaxSegments -+//purpose : -+//======================================================================= -+void BRepOffsetAPI_MakePipeShell::SetMaxSegments(const Standard_Integer NewMaxSegments) -+{ -+ myPipe->SetMaxSegments(NewMaxSegments); -+} -+ -+//======================================================================= - //function : SetForceApproxC1 - //purpose : Set the flag that indicates attempt to approximate - // a C1-continuous surface if a swept surface proved diff --git a/config_files/patches/ParaView-4.1.0.patch b/config_files/patches/ParaView-4.1.0.patch deleted file mode 100644 index 3e68c10..0000000 --- a/config_files/patches/ParaView-4.1.0.patch +++ /dev/null @@ -1,434 +0,0 @@ -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/CMakeLists.txt ParaView-4.1.0_SRC-new/CMakeLists.txt ---- ParaView-4.1.0_SRC-orig/CMakeLists.txt 2014-01-11 17:59:57.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/CMakeLists.txt 2014-05-20 17:23:20.000000000 +0400 -@@ -511,7 +511,7 @@ - - #---------------------------------------------------------------------------------- - # Set some flags that affect VTK's modules. -- set (VTK_NO_PYTHON_THREADS 1 CACHE INTERNAL -+ set (VTK_NO_PYTHON_THREADS OFF CACHE INTERNAL - "Disable Python Threads support" FORCE) - set(VTK_WRAP_PYTHON ${PARAVIEW_ENABLE_PYTHON} - CACHE INTERNAL "Should VTK Python wrapping be built?" FORCE) -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/ParaViewCore/ClientServerCore/Core/vtkPVPluginLoader.cxx ParaView-4.1.0_SRC-new/ParaViewCore/ClientServerCore/Core/vtkPVPluginLoader.cxx ---- ParaView-4.1.0_SRC-orig/ParaViewCore/ClientServerCore/Core/vtkPVPluginLoader.cxx 2014-01-11 17:59:57.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/ParaViewCore/ClientServerCore/Core/vtkPVPluginLoader.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -42,6 +42,13 @@ - #define vtkPVPluginLoaderErrorMacro(x)\ - if (!no_errors) {vtkErrorMacro(<< x);} this->SetErrorString(x); - -+ -+#if defined(_WIN32) && !defined(__CYGWIN__) -+const char ENV_PATH_SEP=';'; -+#else -+const char ENV_PATH_SEP=':'; -+#endif -+ - namespace - { - // This is an helper class used for plugins constructed from XMLs. -@@ -195,7 +202,7 @@ - appDir += "/plugins"; - if(paths.size()) - { -- paths += ";"; -+ paths += ENV_PATH_SEP/*";"*/; - } - paths += appDir; - } -@@ -227,10 +234,15 @@ - << this->SearchPaths); - - std::vector paths; -- vtksys::SystemTools::Split(this->SearchPaths, paths, ';'); -+ vtksys::SystemTools::Split(this->SearchPaths, paths, ENV_PATH_SEP/*';'*/); - for (size_t cc=0; cc < paths.size(); cc++) - { -- this->LoadPluginsFromPath(paths[cc].c_str()); -+ std::vector subpaths; -+ vtksys::SystemTools::Split(paths[cc].c_str(), subpaths, ';'); -+ for (size_t scc=0; scc < subpaths.size(); scc++) -+ { -+ this->LoadPluginsFromPath(subpaths[scc].c_str()); -+ } - } - #else - vtkPVPluginLoaderDebugMacro( -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/ParaViewCore/ClientServerCore/Core/vtkSession.cxx ParaView-4.1.0_SRC-new/ParaViewCore/ClientServerCore/Core/vtkSession.cxx ---- ParaView-4.1.0_SRC-orig/ParaViewCore/ClientServerCore/Core/vtkSession.cxx 2014-01-11 17:59:57.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/ParaViewCore/ClientServerCore/Core/vtkSession.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -30,13 +30,15 @@ - //---------------------------------------------------------------------------- - void vtkSession::Activate() - { -- vtkProcessModule::GetProcessModule()->PushActiveSession(this); -+ if(vtkProcessModule::GetProcessModule()) -+ vtkProcessModule::GetProcessModule()->PushActiveSession(this); - } - - //---------------------------------------------------------------------------- - void vtkSession::DeActivate() - { -- vtkProcessModule::GetProcessModule()->PopActiveSession(this); -+ if(vtkProcessModule::GetProcessModule()) -+ vtkProcessModule::GetProcessModule()->PopActiveSession(this); - } - - //---------------------------------------------------------------------------- -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx ParaView-4.1.0_SRC-new/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx ---- ParaView-4.1.0_SRC-orig/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx 2014-01-11 17:59:57.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/ParaViewCore/ServerManager/Rendering/vtkSMPVRepresentationProxy.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -276,7 +276,7 @@ - { - if (!info) - { -- vtkWarningMacro("Could not determine array range."); -+ // vtkWarningMacro("Could not determine array range."); - return false; - } - -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h ParaView-4.1.0_SRC-new/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h ---- ParaView-4.1.0_SRC-orig/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h 2014-01-11 17:59:57.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/ParaViewCore/VTKExtensions/Default/vtkPVImageReader.h 2014-05-20 17:23:20.000000000 +0400 -@@ -19,27 +19,15 @@ - - #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports - --#ifdef PARAVIEW_USE_MPI --#include "vtkMPIImageReader.h" --#else - #include "vtkImageReader.h" --#endif - --class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVImageReader : public --#ifdef PARAVIEW_USE_MPI --vtkMPIImageReader --#else --vtkImageReader --#endif -+class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkPVImageReader : public vtkImageReader - { - public: - static vtkPVImageReader* New(); - --#ifdef PARAVIEW_USE_MPI -- vtkTypeMacro(vtkPVImageReader, vtkMPIImageReader); --#else -+ - vtkTypeMacro(vtkPVImageReader, vtkImageReader); --#endif - - void PrintSelf(ostream& os, vtkIndent indent); - -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/Qt/Python/pqPythonManager.cxx ParaView-4.1.0_SRC-new/Qt/Python/pqPythonManager.cxx ---- ParaView-4.1.0_SRC-orig/Qt/Python/pqPythonManager.cxx 2014-01-11 18:00:00.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/Qt/Python/pqPythonManager.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -139,7 +139,7 @@ - // initialized (by a startup plugin, for example) - if (vtkPythonInterpreter::IsInitialized()) - { -- importParaViewModule(); -+ //importParaViewModule(); - } - } - ~pqInternal() -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Common/Core/vtkCharArray.h ParaView-4.1.0_SRC-new/VTK/Common/Core/vtkCharArray.h ---- ParaView-4.1.0_SRC-orig/VTK/Common/Core/vtkCharArray.h 2014-01-11 18:02:05.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Common/Core/vtkCharArray.h 2014-05-20 17:23:20.000000000 +0400 -@@ -48,7 +48,26 @@ - // make up the interface of vtkDataArrayTemplate, which is ignored - // by the wrappers. - #ifdef __WRAP__ -- vtkCreateWrappedArrayInterface(char); -+// vtkCreateWrappedArrayInterface(char); -+ -+ // [ABN] manual macro expansion to avoid the last 4 methods (they were BTX/ETX enclosed in -+ // prev versions of PV, meaning not included in the wrapping). -+ int GetDataType(); -+ void GetTupleValue(vtkIdType i, char* tuple); -+ void SetTupleValue(vtkIdType i, const char* tuple); -+ void InsertTupleValue(vtkIdType i, const char* tuple); -+ vtkIdType InsertNextTupleValue(const char* tuple); -+ char GetValue(vtkIdType id); -+ void SetValue(vtkIdType id, char value); -+ void SetNumberOfValues(vtkIdType number); -+ void InsertValue(vtkIdType id, char f); -+ vtkIdType InsertNextValue(char f); -+ -+// T *GetValueRange(int comp); -+// T *GetValueRange(); -+// T* WritePointer(vtkIdType id, vtkIdType number); -+// T* GetPointer(vtkIdType id); -+ - #endif - - // Description: -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx ParaView-4.1.0_SRC-new/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx ---- ParaView-4.1.0_SRC-orig/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2014-01-11 18:02:10.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -74,7 +74,7 @@ - //---------------------------------------------------------------------------- - vtkMatplotlibMathTextUtilities::Availablity - vtkMatplotlibMathTextUtilities::MPLMathTextAvailable = --vtkMatplotlibMathTextUtilities::NOT_TESTED; -+vtkMatplotlibMathTextUtilities::UNAVAILABLE; - - // A macro that is used in New() to print warnings if VTK_MATPLOTLIB_DEBUG - // is defined in the environment. Use vtkGenericWarningMacro to allow this to -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Utilities/Python/vtkPython.h ParaView-4.1.0_SRC-new/VTK/Utilities/Python/vtkPython.h ---- ParaView-4.1.0_SRC-orig/VTK/Utilities/Python/vtkPython.h 2014-01-11 18:02:13.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Utilities/Python/vtkPython.h 2014-05-20 17:23:20.000000000 +0400 -@@ -87,4 +87,14 @@ - #error "Python.h is different version from what VTK was configured with!!" - #endif - -+#ifdef VTK_NO_PYTHON_THREADS -+# define VTK_PY_GIL_ENSURE -+# define VTK_PY_GIL_RELEASE -+#else -+# define VTK_PY_GIL_ENSURE PyGILState_STATE _gstate_avoid_clash = PyGILState_Ensure(); -+# define VTK_PY_GIL_RELEASE PyGILState_Release(_gstate_avoid_clash); -+# -+#endif -+ -+ - #endif -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx ParaView-4.1.0_SRC-new/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx ---- ParaView-4.1.0_SRC-orig/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx 2014-01-11 18:02:13.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Utilities/PythonInterpreter/vtkPythonInteractiveInterpreter.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -45,6 +45,7 @@ - - void CleanupPythonObjects() - { -+ VTK_PY_GIL_ENSURE - Py_XDECREF(this->InteractiveConsoleLocals); - Py_XDECREF(this->InteractiveConsole); - this->InteractiveConsole = NULL; -@@ -54,6 +55,7 @@ - const char* code = "import gc; gc.collect()\n"; - vtkPythonInterpreter::RunSimpleString(code); - } -+ VTK_PY_GIL_RELEASE - } - - PyObject* GetInteractiveConsole() -@@ -65,6 +67,7 @@ - - vtkPythonInterpreter::Initialize(); - -+ VTK_PY_GIL_ENSURE - // set up the code.InteractiveConsole instance that we'll use. - const char* code = "import code\n" - "__vtkConsoleLocals={'__name__':'__vtkconsole__','__doc__':None}\n" -@@ -83,6 +86,7 @@ - { - vtkGenericWarningMacro( - "Failed to locate the InteractiveConsole/InteractiveConsoleLocals object."); -+ VTK_PY_GIL_RELEASE - return NULL; - } - Py_INCREF(this->InteractiveConsole); -@@ -105,7 +109,7 @@ - PySys_SetObject(const_cast("ps2"), ps2 = PyString_FromString("... ")); - Py_XDECREF(ps2); - } -- -+ VTK_PY_GIL_RELEASE - return this->InteractiveConsole; - } - }; -@@ -167,6 +171,7 @@ - i++; - } - -+ VTK_PY_GIL_ENSURE - bool ret_value = false; - PyObject *res = PyObject_CallMethod(console, - const_cast("push"), const_cast("z"), buffer.c_str()); -@@ -179,6 +184,7 @@ - } - Py_DECREF(res); - } -+ VTK_PY_GIL_RELEASE - return ret_value; - } - -@@ -190,12 +196,14 @@ - - this->Internals->GetInteractiveConsole(); //ensure the console is initialized - -+ VTK_PY_GIL_ENSURE - PyObject* context = this->Internals->GetInteractiveConsoleLocalsPyObject(); - PyObject* result = PyRun_String(const_cast(script), Py_file_input, context, context); - - if (result == NULL) - { - PyErr_Print(); -+ VTK_PY_GIL_RELEASE - return -1; - } - -@@ -204,6 +212,7 @@ - { - PyErr_Clear(); - } -+ VTK_PY_GIL_RELEASE - return 0; - } - -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx ParaView-4.1.0_SRC-new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx ---- ParaView-4.1.0_SRC-orig/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2014-01-11 18:02:13.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -60,10 +60,12 @@ - - inline void vtkPrependPythonPath(const char* pathtoadd) - { -+ VTK_PY_GIL_ENSURE - PyObject* path = PySys_GetObject(const_cast("path")); - PyObject* newpath = PyString_FromString(pathtoadd); - PyList_Insert(path, 0, newpath); - Py_DECREF(newpath); -+ VTK_PY_GIL_RELEASE - } - } - -@@ -107,7 +109,6 @@ - //---------------------------------------------------------------------------- - bool vtkPythonInterpreter::Initialize(int initsigs /*=0*/) - { -- vtkPythonInterpreter::InitializedOnce = true; - if (Py_IsInitialized() == 0) - { - #if (VTK_PYTHON_MAJOR_VERSION > 2) ||\ -@@ -117,11 +118,24 @@ - (void)initsigs; - Py_Initialize(); - #endif -- - #ifdef SIGINT - // Put default SIGINT handler back after Py_Initialize/Py_InitializeEx. - signal(SIGINT, SIG_DFL); - #endif -+ } -+ -+ if (! vtkPythonInterpreter::InitializedOnce) -+ { -+#ifndef VTK_NO_PYTHON_THREADS -+ PyEval_InitThreads(); // safe to call this multiple time -+#endif -+ // At this point we have GIL, or we are mono-thread. -+ // Access to the static below is safe: -+ vtkPythonInterpreter::InitializedOnce = true; -+ -+#ifndef VTK_NO_PYTHON_THREADS -+ PyEval_ReleaseLock(); // release GIL -+#endif - // HACK: Calling PyRun_SimpleString for the first time for some reason results in - // a "\n" message being generated which is causing the error dialog to - // popup. So we flush that message out of the system before setting up the -@@ -134,15 +148,17 @@ - vtkPythonStdStreamCaptureHelper* wrapperErr = - NewPythonStdStreamCaptureHelper(true); - -- // Redirect Python's stdout and stderr and stdin -- PySys_SetObject(const_cast("stdout"), -+ // Redirect Python's stdout and stderr and stdin - GIL protected operation -+ VTK_PY_GIL_ENSURE -+ int ret1 = PySys_SetObject(const_cast("stdout"), - reinterpret_cast(wrapperOut)); -- PySys_SetObject(const_cast("stderr"), -+ int ret2 = PySys_SetObject(const_cast("stderr"), - reinterpret_cast(wrapperErr)); -- PySys_SetObject(const_cast("stdin"), -+ int ret3 = PySys_SetObject(const_cast("stdin"), - reinterpret_cast(wrapperOut)); - Py_DECREF(wrapperOut); - Py_DECREF(wrapperErr); -+ VTK_PY_GIL_RELEASE - - for (size_t cc=0; cc < PythonPaths.size(); cc++) - { -@@ -213,6 +229,7 @@ - } - - //---------------------------------------------------------------------------- -+// [ABN] not thread safe for now - only used by pvpython? - int vtkPythonInterpreter::PyMain(int argc, char** argv) - { - if (!vtkPythonInterpreter::InitializedOnce && Py_IsInitialized() == 0 && -@@ -235,7 +252,9 @@ - buffer.erase(std::remove(buffer.begin(), buffer.end(), '\r'), buffer.end()); - - // The cast is necessary because PyRun_SimpleString() hasn't always been const-correct -+ VTK_PY_GIL_ENSURE - PyRun_SimpleString(const_cast(buffer.c_str())); -+ VTK_PY_GIL_RELEASE - } - - //---------------------------------------------------------------------------- -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx ParaView-4.1.0_SRC-new/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx ---- ParaView-4.1.0_SRC-orig/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx 2014-01-11 18:02:14.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/VTK/Wrapping/PythonCore/vtkPythonCommand.cxx 2014-05-20 17:23:20.000000000 +0400 -@@ -30,14 +30,18 @@ - vtkPythonUtil::UnRegisterPythonCommand(this); - if (this->obj && Py_IsInitialized()) - { -+ VTK_PY_GIL_ENSURE - Py_DECREF(this->obj); -+ VTK_PY_GIL_RELEASE - } - this->obj = NULL; - } - - void vtkPythonCommand::SetObject(PyObject *o) - { -+ VTK_PY_GIL_ENSURE - Py_INCREF(o); -+ VTK_PY_GIL_RELEASE - this->obj = o; - } - -@@ -75,11 +79,11 @@ - // If a threadstate has been set using vtkPythonCommand::SetThreadState, - // then swap it in here. See the email to vtk-developers@vtk.org from - // June 18, 2009 with subject "Py_NewInterpreter and vtkPythonCallback issue" -- PyThreadState* prevThreadState = NULL; -- if (this->ThreadState) -- { -- prevThreadState = PyThreadState_Swap(this->ThreadState); -- } -+// PyThreadState* prevThreadState = NULL; -+// if (this->ThreadState) -+// { -+// prevThreadState = PyThreadState_Swap(this->ThreadState); -+// } - - if (ptr && ptr->GetReferenceCount() > 0) - { -@@ -176,10 +180,10 @@ - } - - // If we did the swap near the top of this function then swap back now. -- if (this->ThreadState) -- { -- PyThreadState_Swap(prevThreadState); -- } -+// if (this->ThreadState) -+// { -+// PyThreadState_Swap(prevThreadState); -+// } - - #ifndef VTK_NO_PYTHON_THREADS - #if (PY_MAJOR_VERSION > 2) || \ -diff -Naur --exclude=CVS ParaView-4.1.0_SRC-orig/Wrapping/Python/paraview/servermanager.py ParaView-4.1.0_SRC-new/Wrapping/Python/paraview/servermanager.py ---- ParaView-4.1.0_SRC-orig/Wrapping/Python/paraview/servermanager.py 2014-01-11 18:00:00.000000000 +0400 -+++ ParaView-4.1.0_SRC-new/Wrapping/Python/paraview/servermanager.py 2014-05-20 17:23:20.000000000 +0400 -@@ -1095,7 +1095,7 @@ - property = self.SMProperty - nElems = property.GetNumberOfElements() - if nElems%2 != 0: -- raise ValueError, "The SMProperty with XML label '%s' has a size that is not a multiple of 2." % property.GetXMLLabel() -+ nElems -= 1 - self.__arrays = [] - for i in range(0, nElems, 2): - if self.GetElement(i+1) != '0': -- 2.39.2