0021977: Unsafe implementation of TNaming_Builder
authorszy <szy@opencascade.com>
Fri, 14 Sep 2012 13:20:57 +0000 (17:20 +0400)
committerszy <szy@opencascade.com>
Fri, 14 Sep 2012 13:20:57 +0000 (17:20 +0400)
commit8b8bffc68fcc972622574fb4d9d9445c2c3199cc
tree8ca58bc687c80cea65cfca98d16d892a7efaac39
parentefd4b232bf6786c2f75cb6f84dfe61ca19135a3e
0021977: Unsafe implementation of TNaming_Builder

The code is corrected to create instances of TNaming_Builder class dynamically. Note that they cannot be created as local variables as they should be instantiated only when needed and then reused for the subshapes of the same type in cycle.

Code around is cleaned from tabs and duplicated fragments.

TNaming_Builder class is changed to use Handles instead of C pointers in its fields.
This should protect from possible access to the freed memory if attribute is deleted while instance of TNaming_Builder is still alive.
In addition, method to construct dummy vertex for storing orientation is simplified.
src/TNaming/TNaming_Builder.cdl
src/TNaming/TNaming_NamedShape.cxx