Object Factories question

ThomyKay

Member²
I have a lot of functions in Packages and object types returning TOracleObject/TOracleRefeence/TLOBLocator instances. Also when navigating through object structures (RefAttr, ObjectAttr, LOBAttr) a lot of instances are created.

I know that these instances are registered with TOracleSession and should be freed when the session component is freed. But I want to free these components in another/shorter scope.

Working with BCB, I decided to take auto_ptr to handle this.

When the root object is freed by the auto pointer I see the following picture in OracleMonitor:

xOracleReferenceXX
PinnedObject
LINES
ObjElement

So obviously I deleted OracleReferenceXX. What about the instances of the sub objects? Are they freed by their root object?

What is best practise when working with objects/bcb?
 
Sub-objects obtained by ObjAttr, RefAttr, LOBAttr, ObjElements, and so on are all freed by the parent TOracleObject.

If an instance is not freed by the parent object, this is explicitly documented (like TOracleReference.Pin).

------------------
Marco Kalter
Allround Automations
 
Back
Top