From 8a20cf2905be9638d8f3f171180d329526567e66 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 13 Jan 2021 13:39:05 +0100 Subject: [PATCH] Error at load time of _SMeshHelper.so --- src/SMDS/SMDS_SpacePosition.cxx | 10 ++++++++-- src/SMDS/SMDS_SpacePosition.hxx | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) 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 -- 2.39.2