View Issue Details

IDProjectCategoryView StatusLast Update
0025074CommunityOCCT:Codingpublic2014-11-11 12:53
ReporterEpy Assigned Tobugmaster  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
PlatformMinGW/g++ 4.8.1OSWindows 64-bit 
Product Version6.7.1 
Target Version6.8.0Fixed in Version6.8.0 
Summary0025074: Intf_Polygon2d - add virtual destructor
DescriptionI received the following warnings when compiling:
In file included from /src/IntCurve/IntCurve_IntPolyPolyGen.gxx:47:0,
                 from \drv\Geom2dInt\Geom2dInt_TheIntPCurvePCurveOfGInter_0.cxx:45:
/src/NCollection/NCollection_Handle.hxx: In instantiation of 'NCollection_Handle<T>::Ptr::~Ptr() [with T = Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter]':
/src/IntCurve/IntCurve_IntPolyPolyGen.gxx:1032:1:   required from here
/src/NCollection/NCollection_Handle.hxx:62:28: warning: deleting object of polymorphic class type 'Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
     ~Ptr () { if ( myPtr ) delete myPtr; myPtr = 0; }
                            ^

In file included from /src/IntCurve/IntCurve_IntPolyPolyGen.gxx:47:0,
                 from \drv\HLRBRep\HLRBRep_TheIntPCurvePCurveOfCInter_0.cxx:42:
/src/NCollection/NCollection_Handle.hxx: In instantiation of 'NCollection_Handle<T>::Ptr::~Ptr() [with T = HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter]':
/src/IntCurve/IntCurve_IntPolyPolyGen.gxx:1032:1:   required from here
/src/NCollection/NCollection_Handle.hxx:62:28: warning: deleting object of polymorphic class type 'HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
     ~Ptr () { if ( myPtr ) delete myPtr; myPtr = 0; }
                            ^


My C++ OOP knowledge is minimal, so I will leave it up to OCCT devs to determine whether this is meaningful or not.
TagsNo tags attached.
Test case numberNot needed

Activities

kgv

2014-07-12 13:32

developer   ~0030097

Patch is ready for review in branch CR25074.

Epy

2014-07-13 23:42

developer   ~0030101

Hi, related to the original posted problem:

/home/jake/oce/src/Voxel/Voxel_CollisionDetection.cxx: In member function ‘void Voxel_CollisionDetection::Clear()’:
/home/jake/oce/src/Voxel/Voxel_CollisionDetection.cxx:274:36: warning: deleting object of polymorphic class type ‘Voxel_BoolDS’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
     delete ((Voxel_BoolDS*)myVoxels);
                                    ^

kgv

2014-07-14 14:56

developer   ~0030125

Please test the patch.

mkv

2014-07-17 13:50

tester   ~0030228

Dear BugMaster,

Branch CR25074 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 4151a7173d21d695af9b576b7532413d6baf517b

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)
MacOS: 197 (199 on master)

products component :
Linux: 11 (11 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 352228684 / 352287924
Total CPU difference: 60689.039999999935 / 54524.449999999866

Testing on Windows:
Total MEMORY difference: 377724552 / 378502168
Total CPU difference: 37160.359375 / 46775.625

There are no differences in images found by testdiff.

git

2014-07-22 16:02

administrator   ~0030321

Branch CR25074 has been deleted by inv.

SHA-1: 4151a7173d21d695af9b576b7532413d6baf517b

Related Changesets

occt: master ac83e94f

2014-07-12 09:31:17

kgv


Committer: bugmaster Details Diff
0025074: Intf_Polygon2d - add virtual destructor Affected Issues
0025074
mod - src/Intf/Intf_Polygon2d.cdl Diff File

Issue History

Date Modified Username Field Change
2014-07-12 02:32 Epy New Issue
2014-07-12 02:32 Epy Assigned To => kgv
2014-07-12 13:30 kgv Severity minor => trivial
2014-07-12 13:30 kgv Status new => assigned
2014-07-12 13:30 kgv Target Version => 6.8.0
2014-07-12 13:30 kgv Summary deleting object of polymorphic class with non-virtual destructor might cause undefined behaviour => Intf_Polygon2d - add virtual destructor
2014-07-12 13:30 kgv Description Updated
2014-07-12 13:32 kgv Note Added: 0030097
2014-07-12 13:32 kgv Assigned To kgv => abv
2014-07-12 13:32 kgv Status assigned => resolved
2014-07-13 23:42 Epy Note Added: 0030101
2014-07-14 14:56 kgv Note Added: 0030125
2014-07-14 14:56 kgv Assigned To abv => bugmaster
2014-07-14 14:56 kgv Status resolved => reviewed
2014-07-15 19:17 mkv Assigned To bugmaster => mkv
2014-07-17 13:50 mkv Note Added: 0030228
2014-07-17 13:50 mkv Test case number => Not needed
2014-07-17 13:50 mkv Assigned To mkv => bugmaster
2014-07-17 13:50 mkv Status reviewed => tested
2014-07-22 15:13 bugmaster Changeset attached => occt master ac83e94f
2014-07-22 15:13 bugmaster Status tested => verified
2014-07-22 15:13 bugmaster Resolution open => fixed
2014-07-22 16:02 git Note Added: 0030321
2014-11-11 12:46 aiv Fixed in Version => 6.8.0
2014-11-11 12:53 aiv Status verified => closed