mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0022738: Exception on destruction of Graphic3d_Structure
This commit is contained in:
parent
5e59c041fc
commit
6c8126b56f
@ -110,10 +110,17 @@
|
|||||||
-- Category: Methods to modify the class definition
|
-- Category: Methods to modify the class definition
|
||||||
---------------------------------------------------
|
---------------------------------------------------
|
||||||
|
|
||||||
Clear ( me : mutable )
|
Clear ( me : mutable;
|
||||||
|
theUpdateStructureMgr : Boolean from Standard = Standard_True )
|
||||||
is static;
|
is static;
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Supress all primitives and attributes of <me>.
|
---Purpose: Supress all primitives and attributes of <me>.
|
||||||
|
-- To clear group without update in Graphic3d_StructureManager
|
||||||
|
-- pass Standard_False as <theUpdateStructureMgr>. This
|
||||||
|
-- used on context and viewer destruction, when the pointer
|
||||||
|
-- to structure manager in Graphic3d_Structure could be
|
||||||
|
-- already released (pointers are used here to avoid handle
|
||||||
|
-- cross-reference);
|
||||||
---Category: Methods to modify the class definition
|
---Category: Methods to modify the class definition
|
||||||
|
|
||||||
Destroy ( me : mutable )
|
Destroy ( me : mutable )
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
//-Methods, in order
|
//-Methods, in order
|
||||||
|
|
||||||
void Graphic3d_Group::Clear () {
|
void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
|
||||||
|
{
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
|
||||||
MyCGroup.ContextLine.IsSet = 0,
|
MyCGroup.ContextLine.IsSet = 0,
|
||||||
@ -59,8 +59,11 @@ void Graphic3d_Group::Clear () {
|
|||||||
|
|
||||||
MyGraphicDriver->ClearGroup (MyCGroup);
|
MyGraphicDriver->ClearGroup (MyCGroup);
|
||||||
|
|
||||||
|
// clear method could be used on Graphic3d_Structure destruction,
|
||||||
|
// and its structure manager could be already destroyed, in that
|
||||||
|
// case we don't need to update it;
|
||||||
|
if (theUpdateStructureMgr)
|
||||||
Update ();
|
Update ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::Destroy () {
|
void Graphic3d_Group::Destroy () {
|
||||||
|
@ -261,10 +261,14 @@ void Graphic3d_Structure::Remove () {
|
|||||||
|
|
||||||
Standard_Integer i, Length;
|
Standard_Integer i, Length;
|
||||||
|
|
||||||
// clean groups in graphics driver at first
|
// clean groups in graphics driver at first; this is also should be done
|
||||||
|
// to avoid unwanted group cleaning in group's destructor
|
||||||
|
// Pass Standard_False to Clear(..) method to avoid updating in
|
||||||
|
// structure manager, it isn't necessary, besides of it structure manager
|
||||||
|
// could be already destroyed and invalid pointers used in structure;
|
||||||
Length = MyGroups.Length();
|
Length = MyGroups.Length();
|
||||||
for (Standard_Integer aGrId = 1; aGrId <= Length; ++aGrId)
|
for (Standard_Integer aGrId = 1; aGrId <= Length; ++aGrId)
|
||||||
MyGroups.ChangeValue (aGrId)->Clear();
|
MyGroups.ChangeValue (aGrId)->Clear (Standard_False);
|
||||||
|
|
||||||
// Standard_Address APtr = (void *) This ().operator->();
|
// Standard_Address APtr = (void *) This ().operator->();
|
||||||
Standard_Address APtr = (void *) this;
|
Standard_Address APtr = (void *) this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user