]> OCCT Git - occt.git/commitdiff
0026755: Use of reference to destroyed temporary object in Adaptor3d_SurfaceOfRevolution
authorabv <abv@opencascade.com>
Wed, 7 Oct 2015 10:34:41 +0000 (13:34 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 8 Oct 2015 10:32:25 +0000 (13:32 +0300)
Code corrected to make a copy of temporary object for its further use

src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx

index e7496be9c1222ed11e9168a62187be3a81f1fef5..944f6c11f7ecc249a0d84d1cfb325efeb147a2dd 100644 (file)
@@ -563,7 +563,7 @@ GeomAbs_SurfaceType Adaptor3d_SurfaceOfRevolution::GetType() const
   //
   switch ( myBasisCurve->GetType()) {
   case GeomAbs_Line:    {
-    const gp_Ax1& Axe = (myBasisCurve->Line()).Position();
+    gp_Ax1 Axe = myBasisCurve->Line().Position();
     
     if (myAxis.IsParallel(Axe, TolAng)) {
       bRet=GeomAbs_Cylinder;
@@ -614,8 +614,8 @@ GeomAbs_SurfaceType Adaptor3d_SurfaceOfRevolution::GetType() const
     Standard_Real MajorRadius, aR;
     gp_Lin aLin(myAxis);
     //
-    const gp_Circ& C=myBasisCurve->Circle();
-    const gp_Pnt& aLC=C.Location();
+    gp_Circ C = myBasisCurve->Circle();
+    const gp_Pnt& aLC = C.Location();
     aR=C.Radius();
     //