View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025616 | Open CASCADE | OCCT:Coding | public | 2014-12-16 17:29 | 2020-10-12 23:08 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.7.0 | ||||
Target Version | 6.9.0 | Fixed in Version | 6.9.0 | ||
Summary | 0025616: Avoid Classes using "new" to allocate Instances but not defining a copy Constructor | ||||
Description | 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. | ||||
Steps To Reproduce | not 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. | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
related to | 0031844 | new | Community | Coding - memory leak in Standard_MMgrFactory |
|
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: |
|
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. |
|
No remarks, please test |
|
Branch CR25616 has been updated forcibly by apv. SHA-1: 1b354b8ad02d62f479496367157965f88ecada57 |
|
Branch CR25616 has been rebased on the current master |
|
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 |
|
Branch CR25616 has been deleted by inv. SHA-1: 1b354b8ad02d62f479496367157965f88ecada57 |
occt: master 6a38ff48 2015-01-15 11:41:27
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 |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-12-16 17:29 |
|
New Issue | |
2014-12-16 17:29 |
|
Assigned To | => azn |
2014-12-17 12:42 | git | Note Added: 0035450 | |
2014-12-17 17:08 |
|
Assigned To | azn => abv |
2014-12-17 17:11 |
|
Status | new => resolved |
2014-12-17 17:11 |
|
Steps to Reproduce Updated | |
2014-12-26 15:34 | git | Note Added: 0035761 | |
2014-12-26 16:19 |
|
Note Added: 0035765 | |
2014-12-26 16:19 |
|
Assigned To | abv => bugmaster |
2014-12-26 16:19 |
|
Status | resolved => reviewed |
2014-12-26 16:41 |
|
Assigned To | bugmaster => apv |
2014-12-26 19:46 | git | Note Added: 0035800 | |
2014-12-26 19:46 |
|
Note Added: 0035801 | |
2014-12-29 18:01 |
|
Test case number | => Not needed |
2014-12-29 18:03 |
|
Note Added: 0035846 | |
2014-12-29 18:03 |
|
Assigned To | apv => bugmaster |
2014-12-29 18:03 |
|
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 |
|
Status | verified => closed |
2015-05-14 15:32 |
|
Fixed in Version | => 6.9.0 |
2020-10-12 23:08 | kgv | Relationship added | related to 0031844 |