1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025689: IGESCAFControl_Writer crash in constructor.

Cause of bug is that the IGESData_BasicEditor is created before an initialization of IGESControl_Controller::Init(). IGESData_BasicEditor cannot find template "iges", so the model is still empty after creation.

1) Added a default constructor to the IGESData_BasicEditor. Can be initialized via Init() method.
2) Added some null checks in the places, where are provided access to the model (IGESData_BasicEditor's member).
3) Initialization of the IGESData_BasicEditor was placed after initialization if the IGESControl_Controller.
This commit is contained in:
akz
2015-01-26 19:12:41 +03:00
committed by bugmaster
parent b9c1e44004
commit 843e15cd32
3 changed files with 44 additions and 12 deletions

View File

@@ -48,11 +48,11 @@
IGESControl_Writer::IGESControl_Writer ()
: theTP (new Transfer_FinderProcess(10000)) ,
thedit (IGESSelect_WorkLibrary::DefineProtocol()) ,
thest (Standard_False)
{
// faudrait aussi (?) prendre les parametres par defaut ... ?
IGESControl_Controller::Init();
thedit.Init(IGESSelect_WorkLibrary::DefineProtocol());
thedit.SetUnitName(Interface_Static::CVal ("write.iges.unit"));
thedit.ApplyUnit();
thecr = Interface_Static::IVal ("write.iges.brep.mode");
@@ -62,11 +62,11 @@ IGESControl_Writer::IGESControl_Writer ()
IGESControl_Writer::IGESControl_Writer
(const Standard_CString unit, const Standard_Integer modecr)
: theTP (new Transfer_FinderProcess(10000)) ,
thedit (IGESSelect_WorkLibrary::DefineProtocol()) ,
thecr (modecr) , thest (Standard_False)
{
// faudrait aussi (?) prendre les parametres par defaut ... ?
IGESControl_Controller::Init();
thedit.Init(IGESSelect_WorkLibrary::DefineProtocol());
thedit.SetUnitName(unit);
thedit.ApplyUnit();
themod = thedit.Model();