Anonymous | Login | 2021-01-18 07:19 MSK | ![]() |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0025525 | Community | [OCCT] OCCT:Application Framework | public | 2014-11-27 16:00 | 2017-05-25 15:23 | ||||||||
Reporter | Vico Liang | ||||||||||||
Assigned To | mpv | ||||||||||||
Priority | normal | Severity | minor | ||||||||||
Status | new | Resolution | open | ||||||||||
Platform | Windows | OS | VC++ 2013 | OS Version | 64 bit | ||||||||
Product Version | [OCCT] 6.8.0 | ||||||||||||
Target Version | [OCCT] Unscheduled | Fixed in Version | |||||||||||
Summary | 0025525: TObj_Model shoulde not call its virtual method GetApplication() in constructor. | ||||||||||||
Description | Code snippet: TObj_Model::TObj_Model () { myMessenger = GetApplication()->Messenger(); // VICO: Calling virtual method GetApplication(). } const Handle(TObj_Application) TObj_Model::GetApplication() { return TObj_Application::GetInstance(); } | ||||||||||||
Steps To Reproduce | Calling virtual method in constructor is not recommended. It might not work as expected. It make user failed to derive TObj_Application even if user overrides the GetApplication() method in TObj_Model. What about removing the codes in constructor? The Messenger can be set after model creation. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Test case number | |||||||||||||
Attached Files | |||||||||||||
![]() |
|||
Date Modified | Username | Field | Change |
2014-11-27 16:00 | Vico Liang | New Issue | |
2014-11-27 16:00 | Vico Liang | Assigned To | => szy |
2015-12-15 14:06 | abv | Target Version | 7.0.0 => 7.1.0 |
2016-02-17 18:19 | szy | Assigned To | szy => mpv |
2016-10-25 16:10 | mpv | Target Version | 7.1.0 => 7.2.0 |
2017-05-25 15:23 | mpv | Target Version | 7.2.0 => Unscheduled |
Copyright © 2000 - 2021 MantisBT Team |