View Issue Details

IDProjectCategoryView StatusLast Update
0025616Open CASCADEOCCT:Codingpublic2020-10-12 23:08
ReporteraznAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version6.9.0Fixed in Version6.9.0 
Summary0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor
DescriptionA copy constructor is highly recommended to avoid surprises when an object is initialized using an object of the same type. If an object manages the allocation and deallocation of an object on the heap (the managing object has a pointer to the object to be created by the class' constructor), only the value of the pointer will be copied. This can lead to two invocations of the destructor for the same object (on the heap), probably resulting in a run-time error.
Steps To Reproducenot applicable
Additional information
and documentation updates
The following classes use “new” function without Handles:
- Select3D_PointData
- BSB_T3Bits
- IntPatch_InfoPD
- LDOM_StringElem
- BinomAllocator
- ProjLib_OnSurface
- Standard_MMgrFactory

Objects of these classes must not be copied. It is necessary to add empty copy constructor and assignment operator to protected/private section.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0031844 newabv Community Coding - memory leak in Standard_MMgrFactory 

Activities

git

2014-12-17 12:42

administrator   ~0035450

Branch CR25616 has been created by azn.

SHA-1: f34a4ff91bc50dd227308cbd2022c4d7f5c590ee


Detailed log of new commits:

Author: azn
Date: Wed Dec 17 12:37:06 2014 +0300

    0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor
    
    The empty copy constructor, assignemnts operator, default constructors added to the following classes:

git

2014-12-26 15:34

administrator   ~0035761

Branch CR25616 has been updated by azn.

SHA-1: d4509e50f9ba29d369b6d9b484ecfdfe501111dc


Detailed log of new commits:

Author: azn
Date: Fri Dec 26 15:34:13 2014 +0300

    0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor
    
    Useless declaration of default constructor have been deleted.

abv

2014-12-26 16:19

manager   ~0035765

No remarks, please test

git

2014-12-26 19:46

administrator   ~0035800

Branch CR25616 has been updated forcibly by apv.

SHA-1: 1b354b8ad02d62f479496367157965f88ecada57

apv

2014-12-26 19:46

tester   ~0035801

Branch CR25616 has been rebased on the current master

apv

2014-12-29 18:03

tester   ~0035846

Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component :
   Linux: 11 (11 on master)
   Windows: 1 (1 on master)

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 369216928 / 369132708
Total CPU difference: 50656.09000000034 / 46134.12000000006

Testing on Windows:
Total MEMORY difference: 276574444 / 276918412
Total CPU difference: 39410.21875 / 38326.15625

git

2015-01-26 12:33

administrator   ~0036540

Branch CR25616 has been deleted by inv.

SHA-1: 1b354b8ad02d62f479496367157965f88ecada57

Related Changesets

occt: master 6a38ff48

2015-01-15 11:41:27

azn


Committer: bugmaster Details Diff
0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor

The empty copy constructor, assignemnts operator, default constructors added to the following classes:
The following classes use “new” function without Handles:
- Select3D_PointData
- BSB_T3Bits
- IntPatch_InfoPD
- LDOM_StringElem
- BinomAllocator
- ProjLib_OnSurface
- Standard_MMgrFactory

Useless declaration of default constructor have been deleted.
Affected Issues
0025616
mod - src/Bnd/Bnd_BoundSortBox.cxx Diff File
mod - src/IntPatch/IntPatch_PrmPrmIntersection.cxx Diff File
mod - src/LDOM/LDOM_OSStream.cxx Diff File
mod - src/LDOM/LDOM_OSStream.hxx Diff File
mod - src/PLib/PLib.cxx Diff File
mod - src/ProjLib/ProjLib_ProjectOnSurface.cxx Diff File
mod - src/Select3D/Select3D_PointData.hxx Diff File
mod - src/Standard/Standard.cxx Diff File

Issue History

Date Modified Username Field Change
2014-12-16 17:29 azn New Issue
2014-12-16 17:29 azn Assigned To => azn
2014-12-17 12:42 git Note Added: 0035450
2014-12-17 17:08 azn Assigned To azn => abv
2014-12-17 17:11 azn Status new => resolved
2014-12-17 17:11 azn Steps to Reproduce Updated
2014-12-26 15:34 git Note Added: 0035761
2014-12-26 16:19 abv Note Added: 0035765
2014-12-26 16:19 abv Assigned To abv => bugmaster
2014-12-26 16:19 abv Status resolved => reviewed
2014-12-26 16:41 mkv Assigned To bugmaster => apv
2014-12-26 19:46 git Note Added: 0035800
2014-12-26 19:46 apv Note Added: 0035801
2014-12-29 18:01 apv Test case number => Not needed
2014-12-29 18:03 apv Note Added: 0035846
2014-12-29 18:03 apv Assigned To apv => bugmaster
2014-12-29 18:03 apv Status reviewed => tested
2015-01-16 13:37 bugmaster Changeset attached => occt master 6a38ff48
2015-01-16 13:37 bugmaster Status tested => verified
2015-01-16 13:37 bugmaster Resolution open => fixed
2015-01-26 12:33 git Note Added: 0036540
2015-05-14 15:29 aiv Status verified => closed
2015-05-14 15:32 aiv Fixed in Version => 6.9.0
2020-10-12 23:08 kgv Relationship added related to 0031844