MantisBT - Open CASCADE
View Issue Details
0025616Open CASCADE[OCCT] OCCT:Codingpublic2014-12-16 17:292020-10-12 23:08
azn 
bugmaster 
normalminor 
closedfixed 
[OCCT] 6.7.0 
[OCCT] 6.9.0[OCCT] 6.9.0 
Not needed
0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor
A 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.
not applicable
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.
No tags attached.
related to 0031844new abv Community Coding - memory leak in Standard_MMgrFactory 
Issue History
2014-12-16 17:29aznNew Issue
2014-12-16 17:29aznAssigned To => azn
2014-12-17 12:42gitNote Added: 0035450
2014-12-17 17:08aznAssigned Toazn => abv
2014-12-17 17:11aznStatusnew => resolved
2014-12-17 17:11aznSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8904#r8904
2014-12-26 15:34gitNote Added: 0035761
2014-12-26 16:19abvNote Added: 0035765
2014-12-26 16:19abvAssigned Toabv => bugmaster
2014-12-26 16:19abvStatusresolved => reviewed
2014-12-26 16:41mkvAssigned Tobugmaster => apv
2014-12-26 19:46gitNote Added: 0035800
2014-12-26 19:46apvNote Added: 0035801
2014-12-29 18:01apvTest case number => Not needed
2014-12-29 18:03apvNote Added: 0035846
2014-12-29 18:03apvAssigned Toapv => bugmaster
2014-12-29 18:03apvStatusreviewed => tested
2015-01-16 13:37bugmasterChangeset attached => occt master 6a38ff48
2015-01-16 13:37bugmasterStatustested => verified
2015-01-16 13:37bugmasterResolutionopen => fixed
2015-01-26 12:33gitNote Added: 0036540
2015-05-14 15:29aivStatusverified => closed
2015-05-14 15:32aivFixed in Version => 6.9.0
2020-10-12 23:08kgvRelationship addedrelated to 0031844

Notes
(0035450)
git   
2014-12-17 12:42   
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:
(0035761)
git   
2014-12-26 15:34   
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.

(0035765)
abv   
2014-12-26 16:19   
No remarks, please test
(0035800)
git   
2014-12-26 19:46   
Branch CR25616 has been updated forcibly by apv.

SHA-1: 1b354b8ad02d62f479496367157965f88ecada57
(0035801)
apv   
2014-12-26 19:46   
Branch CR25616 has been rebased on the current master
(0035846)
apv   
2014-12-29 18:03   
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
(0036540)
git   
2015-01-26 12:33   
Branch CR25616 has been deleted by inv.

SHA-1: 1b354b8ad02d62f479496367157965f88ecada57