DiscussionsIssue archiveOCCT:Visualization

Archived issue #0024315

Use delayed release of resources in OpenGl aspects for consistency

Open CASCADEOCCT:Visualizationclosed3 public notes

Search issues

Description

For shared OpenGl resources the common style is to use delayed release procedure. There is an inconsistency in release approaches used within OpenGl aspects - it should be revised in a unified manner.

Delayed release here:
void OpenGl_AspectMarker::Release (...)
{
  ...
      if (myResources.SpriteKey.IsEmpty())
      {
        ...
      }
      else
      {
        ...
        theCtx->ReleaseResource (myResources.SpriteKey,  Standard_True);
        theCtx->ReleaseResource (myResources.SpriteAKey, Standard_True);
      }
  ...
}


But instant release here:
void OpenGl_AspectMarker::Resources::BuildSprites (...)
{
  if (aNewResource)
  {
    if (!Sprite.IsNull())
    {
      if (SpriteKey.IsEmpty())
      {
        ...
      }
      else
      {
        Sprite.Nullify(); // we need nullify all handles before ReleaseResource() call
        aContext->ReleaseResource (SpriteKey);
      }
    }
    ...
  }
  ...
}

Public activity

3 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Dear kgv,

Could you please review CR24315?
02Commenter 2
Please test the patch.
03Commenter 3
Dear Commenter 1,

Branch CR24315 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 317 (317 on master)
Windows: 0 (0 on master)

products component :
Linux: 188 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 357181336 / 357253212
Total CPU difference: 43580.85000000006 / 43279.94000000018

Testing on Windows:
Total MEMORY difference: 411875724 / 411574748
Total CPU difference: 33102.0 / 34417.59375

There are not differences in images found by testdiff.

Related records