From: Anthony Geay Date: Wed, 13 Jan 2021 12:39:05 +0000 (+0100) Subject: Error at load time of _SMeshHelper.so X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a20cf2905be9638d8f3f171180d329526567e66;p=modules%2Fsmesh.git Error at load time of _SMeshHelper.so --- diff --git a/src/SMDS/SMDS_SpacePosition.cxx b/src/SMDS/SMDS_SpacePosition.cxx index 6a2dcf4c9..9a484419d 100644 --- a/src/SMDS/SMDS_SpacePosition.cxx +++ b/src/SMDS/SMDS_SpacePosition.cxx @@ -29,11 +29,11 @@ #include "SMDS_SpacePosition.hxx" #include "SMDS_VertexPosition.hxx" -SMDS_SpacePosition* SMDS_SpacePosition::_originPosition = new SMDS_SpacePosition(); +SMDS_SpacePosition* SMDS_SpacePosition::__originPosition = nullptr; SMDS_PositionPtr SMDS_SpacePosition::originSpacePosition() { - return SMDS_PositionPtr( _originPosition, /*isOwner=*/false ); + return SMDS_PositionPtr( _originPosition(), /*isOwner=*/false ); } SMDS_PositionPtr SMDS_VertexPosition::StaticPosition() @@ -42,3 +42,9 @@ SMDS_PositionPtr SMDS_VertexPosition::StaticPosition() return SMDS_PositionPtr( _vertexPosition, /*isOwner=*/false ); } +SMDS_SpacePosition *SMDS_SpacePosition::_originPosition() +{ + if(!__originPosition) + __originPosition = new SMDS_SpacePosition; + return __originPosition; +} \ No newline at end of file diff --git a/src/SMDS/SMDS_SpacePosition.hxx b/src/SMDS/SMDS_SpacePosition.hxx index c3829010c..d5959870b 100644 --- a/src/SMDS/SMDS_SpacePosition.hxx +++ b/src/SMDS/SMDS_SpacePosition.hxx @@ -40,7 +40,8 @@ class SMDS_EXPORT SMDS_SpacePosition : public SMDS_Position virtual const double* GetParameters() const { return 0; } private: - static SMDS_SpacePosition* _originPosition; + static SMDS_SpacePosition *_originPosition(); + static SMDS_SpacePosition* __originPosition; }; #endif