diff --git a/src/CNRECS.DEF b/src/CNRECS.DEF index e9d9a2243..4b49f80e7 100644 --- a/src/CNRECS.DEF +++ b/src/CNRECS.DEF @@ -5357,6 +5357,7 @@ RECORD DHWSOLARCOLLECTOR "DHWSolarCollector" *RAT // input / runtime DHW solar RECORD PVARRAY "PVArray" *RAT // input / runtime photovoltaics array *prefix pv_ *excon + *exdes *ovrcopy *declare "void FixUp();" // virtual fixup after basAnc reAl *declare "RC Validate( int options=0);" diff --git a/src/geometry.h b/src/geometry.h index b3e4c028e..5766527a5 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -207,12 +207,15 @@ class CPolygon3D { public: CPolygon3D( int n=4) - { if (n>0) + { + if (n>0) p3_vrt.reserve( n); } CPolygon3D( const CPolygon3D& p3) : p3_vrt( p3.p3_vrt) - { /* Copy( ptsAr); */ } + { + /* Copy( ptsAr); */ + } virtual ~CPolygon3D() { DeleteAll(); } void DeleteAll() { p3_vrt.clear(); } int GetSize() const { return static_cast(p3_vrt.size()); } diff --git a/src/pvcalc.cpp b/src/pvcalc.cpp index 5c9398b0b..5034d714a 100644 --- a/src/pvcalc.cpp +++ b/src/pvcalc.cpp @@ -26,12 +26,17 @@ PVARRAY::PVARRAY( basAnc *b, TI i, SI noZ /*=0*/) FixUp(); } // PVARRAY::PVARRAY //----------------------------------------------------------------------------- +PVARRAY::~PVARRAY() +{ +} // PVARRAY::~PVARRAY +//----------------------------------------------------------------------------- /*virtual*/ void PVARRAY::FixUp() // set parent linkage { pv_g.gx_SetParent( this); } //----------------------------------------------------------------------------- /*virtual*/ void PVARRAY::Copy( const record* pSrc, int options/*=0*/) { // bitwise copy of record + pv_g.~SURFGEOM(); // destroy SURFGEOM subobjects before bitwise overwrite record::Copy( pSrc, options); // calls FixUp() // copy SURFGEOM heap subobjects pv_g.gx_CopySubObjects(); diff --git a/src/shading.cpp b/src/shading.cpp index 9370ed82c..1636265be 100644 --- a/src/shading.cpp +++ b/src/shading.cpp @@ -326,8 +326,9 @@ class SURFGEOMDET { friend SURFGEOM; SURFGEOMDET( SURFGEOM* pSG) : gxd_pSG( pSG) - {} + { } SURFGEOMDET( SURFGEOM* pSG, const SURFGEOMDET& sgd); + ~SURFGEOMDET() { } bool gxd_IsEmpty() const // true iff no valid polygon { return gxd_uNorm.IsZero(); } @@ -636,6 +637,7 @@ RC SHADEX::sx_Init() // init at run start //---------------------------------------------------------------------------- void SHADEX::Copy( const record* pSrc, int options/*=0*/) { // bitwise copy of record + sx_g.~SURFGEOM(); // destroy SURFGEOM subobjects before bitwise overwrite record::Copy( pSrc, options); // calls FixUp() // copy SURFGEOM heap subobjects sx_g.gx_CopySubObjects();