Hello!

We have object, for example, objA.

ObjectAType objA = new ObjectAType(...);

// we have a many references to objA

void someFunction1(...)
{
   // destroying the objA
   destroy(one_of_the_refToObjA);

   //........
}


void someFunction2(....)
{
   // "segmentation fault" if the objA is destroyed
   another_refToObjA.method1();

// I need a safe way (without using signals) to detect whether object
   // destroyed or not, like this
   // if (!isDestroyed(another_refToObjA))
   //   another_refToObjA.method1();

}

// call functions
someFunction1(..);

// ..... some other operations...

// the objectA (objA) is destroyed, but debugger shows us a not null reference // to that objA. However, when we try to call some methods of objectA or // try to use it's variables we get a "segmentation fault" error (in
// someFunction2, when objA is destroyed).
someFunction2(...);

Thanks.


Reply via email to