View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013224VTK(No Category)public2012-06-06 20:432013-10-22 15:30
ReporterdennisHu 
Assigned ToDan Lipsa 
PrioritylowSeverityminorReproducibilityhave not tried
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0013224: vtkInteractorObserver destructor calls virtual function SetEnabled
Descriptionvirtual function SetEnabled is called in the destructor of vtkInteractorObserver.
From debug, it just calls empty function in vtkInteractorObserver.

As we know, from http://www.artima.com/cppsource/nevercall.html [^]
Never call virtual functions during construction or destruction.

It's better to remove this call.
I guess SetEnabled(0) will be called in sub-class destructor.
Additional InformationIndeed, it is not the best style to call virtual functions in constructors/destructors as this might suggest that you want derived behavior to be invoked. The C++ standard does specify that the function that is called in this case is the function defined in the current class (the function does not depend on the object the function is called through). It is as if the functions called do not have the virtual keyword.

There are four virtual functions called in the destructor: SetEnabled, SetCurrentRenderer, SetDefaultRenderer and SetInteractor, some are non-empty.

Removing calls to the virtual functions in the destructor might require researching/changing vtkInteractorObserver and tens of derived classes.
TagsNo tags attached.
ProjectTBD
Typeincorrect functionality
Attached Files

 Relationships

  Notes
There are no notes attached to this issue.

 Issue History
Date Modified Username Field Change
2012-06-06 20:43 dennisHu New Issue
2013-10-21 13:40 Dan Lipsa Assigned To => Dan Lipsa
2013-10-21 13:40 Dan Lipsa Status backlog => tabled
2013-10-21 14:18 Dave DeMarle Status tabled => backlog
2013-10-22 13:28 Dan Lipsa Status backlog => closed
2013-10-22 13:28 Dan Lipsa Resolution open => won't fix
2013-10-22 13:28 Dan Lipsa Additional Information Updated
2013-10-22 15:25 Dan Lipsa Status closed => backlog
2013-10-22 15:25 Dan Lipsa Resolution won't fix => reopened
2013-10-22 15:30 Dan Lipsa Status backlog => closed
2013-10-22 15:30 Dan Lipsa Resolution reopened => won't fix
2013-10-22 15:30 Dan Lipsa Additional Information Updated


Copyright © 2000 - 2018 MantisBT Team