[omniORB] Free object reference through ClassFactory ?

Wilson Jimmy - jiwils Jimmy.Wilson@acxiom.com
Thu, 7 Jun 2001 08:41:55 -0500


Just looking at your example I would say that yes, you need to free the
object using the factory call, however, it all depends on what the call to
theFactory->create() does.  If on the server side of the equation, you're
allocating new space for an object, or if your doing some kind of reference
counting to a singleton, you would most likely need to call your
theFactory->destroy( theObj ) method.

Jimmy
-- 
James "Jimmy" Wilson
Software Developer, Acxiom Corporation

-----Original Message-----
From: edward_lin [mailto:edward_lin@EGPALM.com.tw]
Sent: Thursday, June 07, 2001 5:05 AM
To: Omniorb-List (E-mail)
Subject: [omniORB] Free object reference through ClassFactory ?


Hi, Dears
If a corba client creates a corba object reference through the specified
class factory using POA, should the object reference be freed when the
client doesn't need it any more?

MyClassFactory_var		theFactory;
MyClass_var			theObj;

theObj = theFactory->create();
// do something on "theObj"

// need to free ?
theFactory->destroy( theObj );

Best Regards,
Edward Lin