MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026625Community[OCCT] OCCT:Visualizationpublic2015-09-01 16:032016-06-02 22:12
Reporterdc 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.0.0 
Summary0026625: Possible wrong use of vtkSmartPointer<T> in IVtkVTK_ShapeData.cxx
DescriptionIn the constructor of the class there are several invocations in this form:

vtkSmartPointer<vtkObject> MyObject = vtkObject::New()

However according to the vtk wiki this may be wrong. http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers [^]


Excerpt:
#include <vtkSmartPointer.h>
Then you can create an object as follows:

vtkSmartPointer<vtkObject> MyObject = vtkSmartPointer<vtkObject>::New();

Note the special syntax on the right of the assignment. One almost never wants to assign a raw object pointer to a smart pointer, as is done here:

vtkSmartPointer<vtkObject> MyObject = vtkObject::New();

This is almost always a coding error, because the reference count is incremented, requiring an explicit Delete later.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships
parent of 0027567closedbugmaster Open CASCADE VIS - possible memory leaks due to use of plain pointers 

-  Notes
(0047960)
git (administrator)
2015-11-09 17:50

Branch CR26625 has been created by rkv.

SHA-1: f728c562d3ff912ecbbd9c90e8ec470ab15ac9f8


Detailed log of new commits:

Author: rkv
Date: Mon Nov 9 17:49:42 2015 +0300

    0026625: Possible wrong use of vtkSmartPointer<T> in IVtkVTK_ShapeData.cxx
    
    Use vtkSmartPointer<XXX>::New() instead of XXX::New() when initializing fields of vtkSmartPointer<XXX> types.
(0048354)
abv (manager)
2015-11-18 15:39

No remarks, please test compilation and integrate (if testing, run VTK tests only)
(0048357)
git (administrator)
2015-11-18 17:01

Branch CR26625 has been updated forcibly by apv.

SHA-1: d8d12874143001411621d00d8abb1be17404469b
(0048358)
apv (tester)
2015-11-18 17:02

Branch CR26625 has been rebased on the current master
(0048388)
ski (developer)
2015-11-19 17:38

Dear BugMaster,

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

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MacOS: 129 (129 on master)
products component:
   Linux: 39 (39 on master)
   Windows: 0 (0 on master)
(0053096)
git (administrator)
2016-04-17 14:14

Branch CR26625 has been deleted by kgv.

SHA-1: d8d12874143001411621d00d8abb1be17404469b

- Related Changesets
occt: master c16915c7
Timestamp: 2015-11-09 14:49:42
Author: rkv
Committer: bugmaster
Details ] Diff ]
0026625: Possible wrong use of vtkSmartPointer<T> in IVtkVTK_ShapeData.cxx

Use vtkSmartPointer<XXX>::New() instead of XXX::New() when initializing fields of vtkSmartPointer<XXX> types.
mod - src/IVtkVTK/IVtkVTK_ShapeData.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2015-09-01 16:03 dc New Issue
2015-09-01 16:03 dc Assigned To => ski
2015-11-08 22:17 abv Assigned To ski => rkv
2015-11-08 22:17 abv Status new => assigned
2015-11-08 22:17 abv Target Version => 7.0.0
2015-11-09 17:50 git Note Added: 0047960
2015-11-09 17:51 rkv Assigned To rkv => kgv
2015-11-09 17:51 rkv Status assigned => resolved
2015-11-09 17:51 rkv Steps to Reproduce Updated View Revisions
2015-11-17 12:39 kgv Assigned To kgv => abv
2015-11-18 15:39 abv Note Added: 0048354
2015-11-18 15:39 abv Assigned To abv => bugmaster
2015-11-18 15:39 abv Status resolved => reviewed
2015-11-18 16:48 apv Assigned To bugmaster => apv
2015-11-18 17:01 git Note Added: 0048357
2015-11-18 17:02 apv Note Added: 0048358
2015-11-19 17:38 ski Note Added: 0048388
2015-11-19 17:39 ski Assigned To apv => bugmaster
2015-11-19 17:40 bugmaster Test case number => Not needed
2015-11-19 17:40 bugmaster Status reviewed => tested
2015-11-27 12:21 bugmaster Changeset attached => occt master c16915c7
2015-11-27 12:21 bugmaster Status tested => verified
2015-11-27 12:21 bugmaster Resolution open => fixed
2016-04-17 14:14 git Note Added: 0053096
2016-04-20 15:42 user533 Fixed in Version => 7.0.0
2016-04-20 15:50 user533 Status verified => closed
2016-06-02 22:12 abv Relationship added parent of 0027567


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker