← Back to team overview

kicad-developers team mailing list archive

[PATCH 10/16] Replace unshared boost::shared_array with std::unique_ptr

 

These are never shared, so std::unique_ptr works fine, and std::unique_ptr
has a specialisation for array types that uses "operator delete[]", so this
is still correct.
---
 common/gal/opengl/opengl_gal.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp
index 77d51a7..c3fbfee 100644
--- a/common/gal/opengl/opengl_gal.cpp
+++ b/common/gal/opengl/opengl_gal.cpp
@@ -633,7 +633,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque<VECTOR2D>& aPointList )
     gluTessBeginPolygon( tesselator, &params );
     gluTessBeginContour( tesselator );
 
-    boost::shared_array<GLdouble> points( new GLdouble[3 * aPointList.size()] );
+    std::unique_ptr<GLdouble[]> points( new GLdouble[ 3 * aPointList.size() ] );
     int v = 0;
 
     for( std::deque<VECTOR2D>::const_iterator it = aPointList.begin(); it != aPointList.end(); ++it )
@@ -666,7 +666,7 @@ void OPENGL_GAL::DrawPolygon( const VECTOR2D aPointList[], int aListSize )
     gluTessBeginPolygon( tesselator, &params );
     gluTessBeginContour( tesselator );
 
-    boost::shared_array<GLdouble> points( new GLdouble[3 * aListSize] );
+    std::unique_ptr<GLdouble[]> points( new GLdouble[3 * aListSize] );
     int v = 0;
     const VECTOR2D* ptr = aPointList;
 

Follow ups

References